随笔分类 - vue
摘要:mounted() { window.onresize = () => { return (() => { this.$nextTick(() => { if(document.documentElement.clientWidth <= 1000){ this.mode = "vertical"
阅读全文
摘要:第一: 在 package.json 中添加 -- host 0.0.0.0 第二 : 在 vue.config.js 中添加 host: 0.0.0.0
阅读全文
摘要:第一步,先检查是否在main.js中引入 store.js 如果检查完都引入了,且还是存在报错,第二步: 在 package.json 将vuex 的版本更换为其它版本,并从新yarn安装,建议vuex 版本为 3.0然后从新启动项目即可解决
阅读全文
摘要:移入: mouseover和mouseenter最本质的区别是:mouseover支持事件冒泡,mouseenter不支持事件冒泡。移除:mouseleave 仅在指针离开元素时被触发,不冒泡;而 mouseout 在指针离开元素或进入该元素的子元素时均会被触发
阅读全文
摘要:在components中新建文件 iconSvg新建index.vue <template> <svg aria-hidden="true" class="svg-icon" v-bind="$attrs" @click="svgChong"> <use :xlink:href="icon" />
阅读全文
摘要:在assets下新建tool.js文件 function countDownFun(time) { time--; let nowTime = new Date().getTime(); // 获取当前时间 if (time >= nowTime) { var secondTime = 0 //秒
阅读全文
摘要:data(){ return{ data1: [] } }, created() { this.dsdd(7) }, methods:{ getDay(day) { var today = new Date(); var targetday_milliseconds = today.getTime(
阅读全文
摘要:document.querySelector(`#id`).scrollIntoView()
阅读全文
摘要:<div class="details-backgroun" :style="'background-image: linear-gradient(90deg, rgba(19,21,77,.9) 15%,rgba(19,21,77,.1) 80%),url(' + url +');'"> </di
阅读全文
摘要:<div class="banner-background" :style="'background-image:url(' + url +');'"> </div> height: 338px; border-radius: 10px; background-size: 100% 100%; ex
阅读全文
摘要:<script> export default { mounted(){ //addEventlistener 第三个参数必须设置为true addEventListener('scroll',this.handleScroll, true) }, methods:{ handleScroll(){
阅读全文
摘要:遇到这种情况怎么办: 修改视图的数据之后,视图没有从新渲染 首先:先说一下,这是什么原因引起的,在vue2中,是通过Object.defineProperty()来劫持对象属性的setter和getter 来进行操作的,所有就有一个弊端: 1、它无法检测到对象属性上的新增和删除 2、无法检测到数组的
阅读全文
摘要:第一种方式: <router-link :to="{path:'/my_details/my_comment',query:{userInfo:userInfo.headImage}}" > <img src="@/assets/img/my/my_weixin.png" alt /> <h5>我的
阅读全文
摘要:一、安装node.js环境 二、node.js安装完成后使用npm安装vue脚手架vue-cli和安装webpack,我这里用cnpm cnpm i @vue/cli -g //全局安装vue脚手架 npm install webpack -g //全局安装webpack 初始化项目的两种方式 vu
阅读全文

浙公网安备 33010602011771号