
vue
jojo付啾啾
越努力越不想放弃。
展开
-
el-tab 按需加载
el-tab 按需加载 tab原创 2023-01-11 08:50:14 · 1806 阅读 · 0 评论 -
vue.js 如何确保在异步获取成功之后,才进行页面渲染?
在异步请求回来后或者事件监听到后再去实例化Vue原创 2023-01-11 08:32:52 · 1287 阅读 · 1 评论 -
vue-router 异步按需加载组件时增加loading
vue-router 异步按需加载组件时增加loading原创 2022-11-15 14:48:30 · 936 阅读 · 0 评论 -
计算属性和函数的区别
函数:每次调用都会执行(如果数据经常发生变化,推荐使用)计算属性:只要返回的结果没有发生变化,计算属性就只会被执行一次(如果数据不经常变化,推荐使用)原创 2021-05-06 15:24:07 · 644 阅读 · 0 评论 -
vue自定义指令
directive方法接收两个参数:第一个:指令名称(string),不需要v-第二个:配置项(object),指令可以在不同的生命周期阶段执行,参考官方文档的钩子函数:https://cn.vuejs.org/v2/guide/custom-directive.html#%E9%92%A9%E5%AD%90%E5%87%BD%E6%95%B01、自定义全局指令<!DOCTYPE html><html lang="en"><head> &原创 2021-05-06 14:16:52 · 190 阅读 · 0 评论 -
Vue3 究竟好在哪里?(和 React Hook 的详细对比)
写的真好!参考:Vue3 究竟好在哪里?(和 React Hook 的详细对比)原创 2021-04-25 17:53:08 · 415 阅读 · 0 评论 -
postman调用接口成功,前端本地请求接口返回405
postman或其他接口测试工具测试接口成功,前端本地请求接口返回405,本地代理的问题,加上:secure: true即可前端反向代理问题修改前:修改后:参考:https://www.jianshu.com/p/956a0064fe7d原创 2021-01-05 19:43:41 · 5346 阅读 · 3 评论 -
vue.config.js配置代理
proxy: { //配置跨域 '/api': { target: 'https://www.baidu.com/', //这里后台的地址模拟的;应该填写你们真实的后台接口 ws: true, changOrigin: true, //允许跨域 pathRewrite: { "^/api": "" //这里理解.原创 2020-12-30 15:54:53 · 1777 阅读 · 0 评论 -
vue+typescript怎么写computed
export default class xx extends Vue { private get greet(): string { return 'hey' + this.name }}参考:https://blog.youkuaiyun.com/rj0024/article/details/108464573原创 2020-12-29 16:57:49 · 1751 阅读 · 0 评论 -
vue+typescript,三种组件传值方式
参考:https://blog.youkuaiyun.com/qq_34648151/article/details/86707397原创 2020-12-29 16:42:25 · 430 阅读 · 0 评论 -
解决Property ‘$echarts‘ does not exist on type ‘***‘.Vetur(2339)办法
参考:http://www.zyiz.net/tech/detail-132962.html原创 2020-12-23 10:29:38 · 2571 阅读 · 0 评论 -
vue-cli3.0环境变量与模式
参考:https://www.cnblogs.com/heroljy/p/9305263.html原创 2020-12-22 15:06:38 · 143 阅读 · 0 评论 -
vue 在IE11中报错 “对象不支持“assign”属性或方法”
一、ie11打开vue2.0项目空白,控制台报错vuex requires a Promise polyfill in this browserPromise为ES6语法,有的浏览器不支持ES6,所以需要安装babel-polyfill来将ES6转换为浏览器可识别的ES5语法①npm install --save-dev babel-polyfill②在main.js中引入import "babel-polyfill"③在build文件夹中webpack.base.conf.js将//entr..转载 2020-11-04 14:21:52 · 3754 阅读 · 1 评论 -
vue内嵌iframe并跨域通信
参考:https://segmentfault.com/a/1190000016258735?utm_source=tag-newest原创 2020-10-30 13:10:48 · 892 阅读 · 0 评论 -
vue中require引入图片或背景图
<template> <div class="vote-container"> <div class="img" :style="{backgroundImage:'url('+src+')'}"></div> <img :src="src" /> </div></template> <script>export default { data() { retu.转载 2020-10-12 10:48:16 · 3217 阅读 · 0 评论 -
vue-router Uncaught (in promise) NavigationDuplicated
// 解决两次点击同一个路由import Router from 'vue-router'const originalPush = Router.prototype.pushRouter.prototype.push = function push(location, onResolve, onReject) {if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject).原创 2020-09-14 14:13:09 · 159 阅读 · 0 评论 -
vue .native
有时发现用一些第三方的组件库时,例如一个封装好的button按钮,绑定点击事件却没有任何作用,这时便需要加 .native原因:v-on是对 Vue 的事件体系封装后的 API 接口,官方文档中指出Vue 使用的是一套自己的事件传递机制,如@click等事件是经过 Vue 封装的。所以在一些实际上处理 DOM 原生事件的场合需要添加额外的标识符。而.native就是给组件绑定原生...转载 2020-04-29 12:09:06 · 652 阅读 · 0 评论 -
vue-lazyload
参考:https://www.npmjs.com/package/vue-lazyloadvue图片懒加载 —— vue-lazyload的使用vue 图片懒加载插件 vue-lazyload 使用说明原创 2020-04-10 10:46:10 · 224 阅读 · 0 评论 -
报错解析 [Vue warn]: You may have an infinite update loop in a component render function.
转自:https://blog.youkuaiyun.com/u011584949/article/details/83821278参考vue issue:https://github.com/vuejs/vue/issues/1153转载 2019-10-21 16:44:01 · 206 阅读 · 0 评论 -
Vue2.0+组件库总结
Vue2.0+组件库总结转载 2018-11-27 16:48:21 · 190 阅读 · 0 评论 -
Vue.install插件开发简单示例
<html> <style> @keyframes rotate { 0% {transform:rotateX(0)} 50% {transform:rotateX(180deg)} 100% {transform:rotateX(0deg)} } .loading{ animation:rotate 2s infinit...原创 2019-06-20 18:13:25 · 899 阅读 · 0 评论 -
vue组件与插件的区别
组件 (Component) 是用来构成你的 App 的业务模块,它的目标是App.vue。插件 (Plugin) 是用来增强你的技术栈的功能模块,它的目标是 Vue 本身。转自:Vue 组件和插件的关系...转载 2019-06-03 14:24:05 · 2219 阅读 · 0 评论 -
Vue组件的三种调用方式
Vue组件的三种调用方式参考:vue中extend,mixins,extends,components,install的几个操作转载 2019-06-03 11:35:52 · 753 阅读 · 0 评论 -
vue实现刷新页面仍保持选中状态
参考:https://router.vuejs.org/zh/guide/essentials/dynamic-matching.html原创 2019-06-06 18:51:58 · 6343 阅读 · 0 评论 -
Vue——插件的两种实现方式
Vue——插件的两种实现方式转载 2019-05-31 15:53:05 · 396 阅读 · 0 评论 -
2019/5/27——自学封装vue插件
1、用官方提供的vue-cli来构建项目 这里选择了webpack-simple(组件相对而言比较简单,不需要很多复杂的功能,所以 webpack-simple 已经满足需求了)$ npm install -g vue-cli$ vue init webpack-simple my-project$ cd my-project$ npm install2、...写组件...原创 2019-05-27 15:43:35 · 264 阅读 · 0 评论 -
Uncaught SyntaxError: Unexpected token <
转自:https://www.jianshu.com/p/6c3c33c43509转载 2019-06-28 10:12:54 · 1400 阅读 · 0 评论 -
从0开始开发一个vue组件并发布npm,这一篇文章就够了
从零开始开发一个vue组件打包并发布到npm (把vue组件打包成一个可以直接引用的js文件)https://www.cnblogs.com/Kiddzz/p/8471521.htmlhttps://www.jianshu.com/p/b931abe383e3参考:https://imweb.io/topic/5985e4ed35d7d0a321c5eb82...转载 2019-07-12 19:12:35 · 423 阅读 · 0 评论 -
解决Vue computed计算属性中使用$refs进行dom操作时出现undefined问题
转自:https://blog.youkuaiyun.com/daivon_up/article/details/80149416转载 2019-07-19 16:22:12 · 5030 阅读 · 0 评论 -
vue中 computed 下使用箭头函数会报错
转自:https://blog.youkuaiyun.com/sinat_36422236/article/details/84620403转载 2019-07-24 16:52:05 · 522 阅读 · 0 评论 -
vue中v-model使用计算属性
转自:https://blog.youkuaiyun.com/qq_34414994/article/details/82688159转载 2019-07-24 20:26:56 · 13329 阅读 · 1 评论 -
vue 在一个元素上同时绑定单击和双击事件
转自:https://blog.youkuaiyun.com/xingbipai5492/article/details/89881589转载 2019-07-30 15:46:02 · 3731 阅读 · 0 评论 -
vue实现文件上传
转自:https://blog.youkuaiyun.com/hzschqh/article/details/79713889转载 2019-07-21 20:38:01 · 35272 阅读 · 0 评论 -
axios onDownloadProgress和onUploadProgress配置进度条
转自:axios onDownloadProgress和onUploadProgress配置进度条转载 2019-07-22 18:42:16 · 4317 阅读 · 0 评论 -
Vue.extend(options)
到目前位置还没有见过比vue文档写的更好的文档了原创 2019-08-09 16:31:37 · 1058 阅读 · 3 评论 -
vue 2.0 watch 监听对象的变化
转自:https://www.cnblogs.com/anani/p/9287986.html转载 2019-08-22 14:12:18 · 295 阅读 · 0 评论 -
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.解决方法...转载 2019-05-22 11:39:29 · 177 阅读 · 0 评论 -
如何在vue中引入本地的音频文件
转自:https://www.2cto.com/kf/201708/666425.html转载 2019-05-20 17:23:09 · 7582 阅读 · 0 评论 -
拿到一个vue+webpack项目,该如何去看
这也是我目前自己这么理解的,可能每个人看代码的过程也不一样,我这里也是拿到一个项目之后不知道如何开始,所以自己在慢慢摸索,然后记录下来,希望自己能不断超越自己。这里我不能把公司项目亮出来,所以。。。只能记个大概1.先看配置文件package.json,里面定义了这个项目所需要的各个模块,以及项目的配置信息。scripts指定了运行脚本命令的npm命令行缩写,比如dev指定了运行npm run ...原创 2018-08-29 14:28:21 · 7483 阅读 · 1 评论 -
vue页面跳转后返回原页面初始位置
vue页面跳转后返回原页面初始位置参考:vue-router如何在返回时返回到上次滚动位置 方法集锦转载 2018-12-12 15:33:43 · 5860 阅读 · 0 评论