hykeda2年前1689
在使用Switch开关时,发现v-model可以绑定boolean / string / number 三种类型的数据,默认绑定的是布尔型。但是后台返回的数据是数字形型的,0或1const ...
hykeda2年前2241
最近在开发vue3时,定义了一个变量:let form = reactive({});form = res.items;这里我将接口获取到的数据直接赋给了form,这样我在表单中:<el-for...
hykeda2年前1155
在写js方法时,现在有很多种写法:写法1:最最常见的写法function test(params){ //内部 }写法2:变量形式,箭头函...
hykeda2年前1018
在使用uniapp开发微信小程序时,使用了block标签进行了逻辑判断:<block v-show="list.type === 2">...
hykeda2年前824
在使用axios时,在终端用console.log 打印出来返回的是Promise对象,如下图:如果直接用res.code是无法获取的,Promise对象需要使用.then()方法来获取值:res.t...
hykeda2年前2992
最近在开发vite+vue项目时,调用接口获取服务器数据时提示接口有跨域问题,解决办法是配置代理:export default defineConfig({ //配置代理 se...
hykeda2年前923
一、字符串类型let str:string = '123' 二、数值类型let num:number = 123;...
hykeda2年前1461
在vuex中获取state中的数据可以解构的方式如下:import { mapState,mapMutations } from "vuex...
hykeda2年前1299
自动引入插件:https://github.com/antfu/unplugin-auto-importvue的按需组件自动导入:https://github.com/antfu/unplugin-v...
hykeda2年前2573
一、Pinia持久化存储二、使用步骤1.安装插件代码如下(示例):npm i pinia-plugin-persist --save2.store/index.js代码如...