随笔分类 -  vue

vue 中的 常用小技巧
摘要:vue3.x 减少import使用 大家在写vue时,各种api的导入比如ref,reactive还有生命周期函数等,还有类似element-plus导入等重复无聊的操作,下面介绍个插件,减少import npm install -D unplugin-vue-components unplugin 阅读全文 »
posted @ 2023-02-21 14:13 有点油 阅读(403) 评论(0) 推荐(0) 编辑
摘要:区别devDependencies和dependencies devDependencies用于本地环境开发时候所需要的依赖包。 dependencies用户发布环境,生成上所需要的依赖包 上面的说法 对于初学者来说有点抽象,在使用npm 安装时 不知道 使用-S (--save) 还是使用-D(- 阅读全文 »
posted @ 2021-12-31 14:09 有点油 阅读(97) 评论(0) 推荐(0) 编辑
摘要:function isObject(target) { return typeof target 'object' && target !== null } function hasOwn(target, key) { return Reflect.has(target, key) } let to 阅读全文 »
posted @ 2021-07-06 14:18 有点油 阅读(65) 评论(0) 推荐(0) 编辑
摘要:// 2.x 响应式原理 const oldArrayPrototyoe = Array.prototype; // 继承 创建新的原型 const proto = Object.create(oldArrayPrototyoe); ['push', 'unshift', 'shift'].forE 阅读全文 »
posted @ 2021-07-05 16:05 有点油 阅读(53) 评论(0) 推荐(0) 编辑
摘要:一文带你掌握Vue3新特性 前言 记录一下笔记,给各位小伙伴们分享一些常用的Vue3新特性及哪些方法发生了变更。 写法采用vue3.x,当然目前vue3 版本时支持vue2.x的写法的 我这里只写一些常用的,更多请看Vue3官网这里 Setup setup函数是一个新的组件选项。作为在组件内使用Co 阅读全文 »
posted @ 2021-04-25 10:36 有点油 阅读(821) 评论(0) 推荐(0) 编辑
摘要:Vue 3 新出的 Composition API 可以优雅的聚集零散业务代码。如果想在 Vue2 的项目中使用 Composition API 怎么办? 可以使用官方出的插件:@vue/composition-api。 @vue/composition-api 介绍 安装: npm install 阅读全文 »
posted @ 2021-04-22 10:39 有点油 阅读(5865) 评论(0) 推荐(1) 编辑
摘要:vue 的生命周期函数想必大家都很熟悉,下面总结下 beforeCreate() { // vue实例创建,但是这里的data 并未初始化 // this 已经被创建, this.a undefined }, created() { // 这里的data 已初始化, }, beforeMount() 阅读全文 »
posted @ 2021-04-21 14:46 有点油 阅读(54) 评论(0) 推荐(0) 编辑
摘要:const path = require('path') const resolve = (dir) => path.join(__dirname, dir); //将文件组成绝对路径 const CompressionPlugin = require("compression-webpack-pl 阅读全文 »
posted @ 2021-04-12 11:19 有点油 阅读(352) 评论(0) 推荐(0) 编辑
摘要:const CompressionPlugin = require("compression-webpack-plugin") module.exports = { configureWebpack:config=>{ if(process.env.NODE_ENV 'production'){ r 阅读全文 »
posted @ 2021-04-02 15:29 有点油 阅读(751) 评论(0) 推荐(0) 编辑
摘要:module.exports = { pages: { index: { // page 的入口 entry: 'src/main.js', // 模板来源 template: 'public/index.html', // 在 dist/index.html 的输出 filename: 'inde 阅读全文 »
posted @ 2021-04-02 09:46 有点油 阅读(400) 评论(0) 推荐(0) 编辑
摘要:第一种 使用 vue-cli-plugin-style-resources-loader style-resources-loader vue.config.js 配置 const path = require('path') module.exports = { pluginOptions: { 阅读全文 »
posted @ 2021-04-01 10:55 有点油 阅读(306) 评论(0) 推荐(0) 编辑
摘要:vue3.0 已经在9.18日正式发布了,现在介绍两种 创建项目方法 1. 使用webpack 先安装vue-cli4 vue create project-name 在选项中选择vue3 就可以了 2. 使用Vite(是vue团队开发的一款试图代替webpack的工具) 使用 npm $ npm 阅读全文 »
posted @ 2020-09-22 16:00 有点油 阅读(1199) 评论(0) 推荐(1) 编辑
摘要:在网上看了很多案例,大部分使用起来都会报错,可能是版本太低了。 近期一个项目中需要用到tinymce 整合了网上的一些攻略,终于成功了,现在分享一下, 我使用的是5.3.2版本, 1. 安装tinymce-vue npm install @tinymce/tinymce-vue -S 2. 安装ti 阅读全文 »
posted @ 2020-09-09 10:09 有点油 阅读(1311) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示