随笔分类 -  前端

摘要:// 获取composition API 上下文对象 const { ctx } = getCurrentInstance() vue2 可以通过this.$xxx 获取在main.js中挂载的全局对象 vue3中的composition API 需要通过从vue中导入getCurrentInsta 阅读全文
posted @ 2021-07-05 16:13 LJLong 阅读(2221) 评论(0) 推荐(0)
摘要:const res = await User.findOne({ userName, userPwd }, 'userId userName userEmail state role deptId roleList') 第一个参数是条件字段, 第二个参数是指定查询字段 1、字符串类型用空格分割如:' 阅读全文
posted @ 2021-07-04 17:36 LJLong 阅读(59) 评论(0) 推荐(0)
摘要:一、组件地址必须带后缀.vue // 正确 import ('./../views/xxx.vue') // 错误 import ('./../views/xxx') 二、在使用vite开发时,可以配置别名,用来解决./../问题.类似于Vue里面的@(注:在vite.config.js里面配置) 阅读全文
posted @ 2021-07-04 14:31 LJLong 阅读(72) 评论(0) 推荐(0)
摘要:const routes = [ { name: 'home', path: '/', component: Home, meta: { title: '首页' }, redirect: '/welcome', children: [ { name: 'welcome', path: '/welco 阅读全文
posted @ 2021-07-04 14:20 LJLong 阅读(40) 评论(0) 推荐(0)