上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: 安装淘宝镜像遇见一下问题 查看是否安装成功: node的版本号查看: node -v;node的版本号在14.0以上; npm的版本号查看:npm -v;npm的版本号在6.0以上; 淘宝镜像的cnpm的版本号查看:cnpm -v;cnpm的版本号在6.5以上; 查看vue是否安装成功:vue -V 阅读全文
posted @ 2022-05-07 23:42 干饭吧 阅读(69) 评论(0) 推荐(0)
摘要: let obj = {}; let index = 1; obj[`topic${index}`] = '话题内容'; 阅读全文
posted @ 2022-04-22 15:25 干饭吧 阅读(35) 评论(0) 推荐(0)
摘要: 假设你有一个按钮,在某些情况下想监听单击事件,在某些情况下想监听双击事件。这时动态指令参数派上用场: <template> <div> <aButton @[someEvent]="handleSomeEvent()" /> </div></template><script>export defau 阅读全文
posted @ 2022-04-22 10:58 干饭吧 阅读(398) 评论(0) 推荐(0)
摘要: 这是因为vue-router会识别出两个路由使用的是同一个组件从而进行复用,并不会重新创建组件,而且组件的生命周期钩子自然也不会被触发,导致跳转后数据没有更新。那我们如何解决这个问题呢?我们可以为router-view组件添加属性key, { path: "/detail/:id", name:"d 阅读全文
posted @ 2022-04-22 10:56 干饭吧 阅读(976) 评论(0) 推荐(0)
摘要: 在Vue组件中,可以用过once去监听所有的生命周期钩子函数,如监听组件的updated钩子函数可以写成 this.$on(‘hook:updated’, () => {})。 hook除了上面的运用外,还可以外部监听组件的生命周期函数。在某些情况下,我们需要在父组件中了解一个子组件何时被创建、挂载 阅读全文
posted @ 2022-04-22 10:54 干饭吧 阅读(1386) 评论(0) 推荐(0)
摘要: mounted() { let timer = setInterval(() => { // ...... }, 500); this.$once("hook:beforeDestroy", function() { if (timer) { clearInterval(timer); timer 阅读全文
posted @ 2022-04-22 10:53 干饭吧 阅读(1725) 评论(0) 推荐(0)
摘要: import BaseButton from './baseButton'import BaseIcon from './baseIcon'import BaseInput from './baseInput' export default { components: { BaseButton, B 阅读全文
posted @ 2022-04-22 10:52 干饭吧 阅读(290) 评论(0) 推荐(0)
摘要: let a =[1,2,3,1,5,undefined]a.filter(Boolean)//[1,2,3,1,5]假设做条件判断 data=[undefined]if(data[0]==undefined){alert("重新设置数据")} 阅读全文
posted @ 2022-04-20 16:27 干饭吧 阅读(339) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-04-11 21:33 干饭吧 阅读(123) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-04-06 15:03 干饭吧 阅读(46) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页