07 2022 档案
摘要:1.mapState方法:用于映射state中的计算属性 import {mapState} from 'vuex' computed:{ //借助mapState生成属性:sum , school ,对象写法 ...mapState({sum:'sum',school:'school'}), //
阅读全文
摘要:1. assets 创建css 文件, 把css外部文件放入 app.vue 里面 important 直接引入 2. 碰到 缺少字体文件的外部css ,放在public文件下面,新建css文件 <link rel="stylesheet" href="<%= BASE_URL %>css/xxx.
阅读全文
摘要:1. 判断对象有没有这条属性 hasOwnProperty let obj = { a:1, b:2 } console.log(obj.hasOwnProperty("c")); //false console.log(obj.hasOwnProperty("a")); //true 2.对象删除
阅读全文
摘要:1.一种组件间通信的方式,适用于任意组件间通信 2.使用步骤 1.安装pubsub: npm i pubsub-js 2. 引入: import pubsub from 'pubsub-js' 3.接收数据 : A组件想接受数据,则在A组件中订阅消息,订阅的回调留在A组件自身, mounted(){
阅读全文
摘要:1.首先在main.js中配置全局总线 import Vue from 'vue' import App from './App.vue' Vue.config.productionTip = false new Vue({ render: h => h(App), beforeCreate(){
阅读全文
摘要:1. 插件地址 https://www.itxst.com/vue-draggable/tutorial.html 配合element 的table <template> <div> <el-table :data="tableData" style="width: 100%" row-key="i
阅读全文
摘要:Nanoid npm i nanoid import {nanoid} from 'nanoid' 调用 {id:nanoid()}
阅读全文
摘要:折叠代码前面加 #region 后面加 #endregion //#region // // // // // //#endregion
阅读全文
摘要:1.先卸载 清除环境变量 卸载Git 软件 2.下载对应版本 无脑安装下一步使用 https://registry.npmmirror.com/binary.html?path=git-for-windows/ 3.基本的Linux命令 1. cd : 改变目录 2. cd .. 回退到上一个目录,
阅读全文
摘要:<script> import {query} from '@/api/index' export default { data() { return {}; }, created() { this.Init() }, methods: { async Init() { const res = aw
阅读全文
摘要:1. Date.now() H5新增的获取总的毫秒数(时间戳) 2.倒计时 function countDown(time) { let nowTime = Date.now(); //获取当前时间戳 let inputTime = +new Date(time); //获取用户输入的时间戳 let
阅读全文