摘要: <el-tooltip class="box-item" effect="dark" :content="lv 1?'删除类别':'删除标签'" placement="top-start" v-if="props.isLeaf" > <!-- tooltip的触发源 --> <div @click. 阅读全文
posted @ 2022-04-21 18:05 Life_countdown 阅读(1372) 评论(0) 推荐(0)
摘要: vite不需要全局安装(若需要全局安装:npm install -g create-vite-app) pnpm create vite (第一步:选择项目名称 第二步:框架 第三步:Cutomize with create-vue) 或者 yarn create vite (第一步:选择项目名称 阅读全文
posted @ 2022-04-21 14:10 Life_countdown 阅读(686) 评论(0) 推荐(0)
摘要: // 思路:利用组件内的路由守卫(Leave:离开时触发)通过to.path或者from.path来判断是前进还是后退(只适用于某些筛选条件返回上一层时还保留原值,若页面输入框过多,还是使用keep-alive) // 1前进: 把需要保存的状态存到vuex中,在进入页面时利用vuex存储的值重新赋 阅读全文
posted @ 2022-04-19 15:42 Life_countdown 阅读(488) 评论(0) 推荐(0)
摘要: export const dateFormat = (time) => { const date = new Date(time); const myyear = date.getFullYear(); let mymonth = date.getMonth() + 1; let myweekday 阅读全文
posted @ 2022-04-14 13:23 Life_countdown 阅读(41) 评论(0) 推荐(0)
摘要: // 同步和异步,异步又分为宏任务和微任务,优先执行同步任务,在执行微任务,最后执行宏任务 function fun(item) { return new Promise(resolve => { resolve(item) setTimeout(() => { console.log(item, 阅读全文
posted @ 2022-04-01 09:25 Life_countdown 阅读(43) 评论(0) 推荐(0)
摘要: <template> <div @click="change">自由浏览</div> <component :is="CurrentCompoent[current]" ></component> </template> import { defineAsyncComponent, markRaw, 阅读全文
posted @ 2022-03-31 15:24 Life_countdown 阅读(4440) 评论(0) 推荐(0)
摘要: const arr = [1, 2, 3] // map循环 当item是简单数据类型时,不会修改原数组,复杂类型时会修改 const newArr = arr.map(item => item*2) console.log(arr, newArr); // 这种会影响源数据 const arr1 阅读全文
posted @ 2022-03-29 10:43 Life_countdown 阅读(57) 评论(0) 推荐(0)
摘要: import Test from 'Test.vue' render: h => { return h(Test,{ // 监听Test组件触发的方法 onTest() { console.log(111) } }, '') } // Test.vue组件 <template> <div class 阅读全文
posted @ 2022-03-28 15:33 Life_countdown 阅读(1617) 评论(0) 推荐(0)
摘要: <div class="tree_box"> <el-tree :data="treeData.list" node-key="id" :expand-on-click-node="false" :render-content="renderContent" /> </div> const tree 阅读全文
posted @ 2022-03-20 18:34 Life_countdown 阅读(1684) 评论(0) 推荐(0)
摘要: <el-dialog :close-on-click-modal="false" v-model="dialogFormVisible" :width="500" :before-close="handleClose" title="新增标签类别"> <el-form ref="ruleFormRe 阅读全文
posted @ 2022-03-20 15:04 Life_countdown 阅读(1346) 评论(0) 推荐(0)