Vue 坑队友之神代码

var array = ["aaa", "aaaaaa"]; for (var i = 0; i < array.length; i++) { array += array[i] + '|'; } Vue 下使用 此代码可导致浏览器直接卡死,当执行到此代码时,浏览器该页面之间卡死,无日志输出

vue 自定义功能封装

main.js // The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import Vuex from 'vuex' import VueResource from 'vue-resource' import MintUI from 'mint-ui' import router from './router' import Comm from './comm' import Service from './service' import MyContainer from './components/MyContainer' import ArticleContainer from './components/ArticleContainer' import HeaderContainer from './components/HeaderContainer' import '../static/css/style.css' import '../static/css/font/iconfont.css' Vue.use(VueResource); Vue.http.options.root = 'http://127.0.0.1:11111'; Vue.http.options.emulateJSON = true; Vue.use(Vuex); Vue.use(MintUI); Vue.use(Comm); Vue.use(Service); Vue.component('my-container', MyContainer); Vue.component('article-container', ArticleContainer); Vue.component('header-container', HeaderContainer); /* eslint-disable no-new */ new Vue({ el: '#app', router, }) 方式一 comm.js ...

Vue3打包相对路径_本地可访问

Vue3打包相对路径_本地可访问 1.配置打包相对路径 配置文件: vue.config.js 配置属性: publicPath 示例 module.exports = { publicPath: './' } 2.修改路由 路由修改为 [createWebHashHistory] 示例 import {createRouter, createWebHashHistory} from 'vue-router' import {staticRouter} from '@/core/router/xstech' const router = createRouter({ history: createWebHashHistory(), routes: staticRouter }) 创建时间 2022年2月27日 更新时间 2022年2月27日

Vue3路由

Vue3路由 创建路由 1.创建路径 2.在main中引用路由 import {createRouter, createWebHistory} from 'vue-router' const router = createRouter({ history: createWebHistory(), routes: [ { path: '/', redirect: '/home', }, { path: '/home', component: () => import('@/views/xstech/Home') } ] }) router.beforeEach((to, from, next) => { to.last = from next() }) export default router main.js import {createApp} from 'vue' import Application from './Application.vue' const app = createApp(Application) app.use(router) 路由模式 1.history模式 history模式网页路径为 http://xxx/Home 使用createWebHistory函数创建 import {createRouter, createWebHistory} from 'vue-router' const router = createRouter({ history: createWebHistory(), routes: [] }) 2.hash模式 hash模式网页路径为 http://xxx/#/Home 使用createWebHashHistory函数创建 import {createRouter, createWebHashHistory} from 'vue-router' const router = createRouter({ history: createWebHashHistory(), routes: [] }) 创建时间 2022年3月1日 更新时间 2022年3月1日 ...

Vue多线程_异步_WebWorker

Vue3 多线程 异步 WebWorker 1.添加依赖库 yarn add vue-worker 2.示例代码 import SimpleWebWorker from 'simple-web-worker' generate() { this.generateBtnDisabled = true SimpleWebWorker.run(() => { // 异步处理逻辑 return { publicKey: "", privateKey: "" } }).then(res => { this.generateBtnDisabled = false this.publicKey = res.publicKey this.privateKey = res.privateKey }) }, 创建时间 2022年3月5日 更新时间 2022年3月5日

Vue使用Markdown(md-editor-v3)

Vue使用Markdown(md-editor-v3) 1.安装md-editor-v3 yarn add md-editor-v3 2.基本使用 markedHeading参数是解决点击标题跳转问题 <template> <md-editor v-model="mdText" :markedHeading="markedHeading" previewOnly/> </template> <script> import MdEditor from 'md-editor-v3'; import 'md-editor-v3/lib/style.css'; export default { name: "Content", components: {MdEditor}, data() { return { mdText: '# aaa' } }, methods:{ markedHeading(text, level, raw){ return `<h${level} id="${raw}">${text}</h${level}>`; } } } </script> <style lang="less" scoped> </style> 创建时间 2022年3月1日 更新时间 2022年3月1日

vue使用mint-ui 导入样式

安装插件,根据需要插件自动导入相关样式 npm i babel-plugin-component -D 在.babelrc 文件中配置 ["component",[ {"libraryName":"mint-ui","style":true} ]] 完整配置 npm i babel-plugin-component -D .babelrc { "presets": [ ["env", { "modules": false, "targets": { "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] } }], "stage-2" ], "plugins": ["transform-runtime",["component",[ {"libraryName":"mint-ui","style":true} ]]], "env": { "test": { "presets": ["env", "stage-2"], "plugins": ["istanbul"] } } }

webStorm vue+webpack 打包采坑

打包之后没有引号 removeAttributeQuotes:true //修改为 removeAttributeQuotes:false 打包之后绝对路径问题,修改为 assetsPublicPath:'./' assetsSubDirectory:'./'

各语言基础语法采坑

C# 优点 委托很赞 缺点 不支持case穿透 不支持多继承 Java 优点 强大的生态圈,不是一般的强大 缺点 不支持多继承 C++ 优点 不要花里胡哨的 效率第一 支持多继承 缺点 对新手不友好 开发效率慢 Python 优点 开发效率确实快 缺点 运行效率也确实不行 Go 优点 在开发效率和运行效率中取了中间点 初学go 感觉很多骚操作,很赞

黑苹果安装

1.先安装VM虚拟机 2.停止VM服务 操作:此电脑上右击->管理->服务和应用程序->服务->按名称排序->将vm开通的服务全部停止 3.以管理员身份运行unlocker 工具中的win-install 工具名称:unlocker for VMware 工具下载地址:https://dl.lancdn.com/landian/software/unlocker/ 说明 vm本身在安装时时没有mac 系统的选项的,运行该工具之后就有了mac系统这个选项了 4.(1)vm安装时选择 ***.cdr的文件, (2)选择典型,mac os 及对应的版本 (3)开启虚拟机等待开机设置即可 这样安装的是可以直接更新系统的(亲测可用) 采坑 在分辨率自适应上有很大的坑 需要将vim tool安装两遍 1.安装第一遍正常安装 2.重启之后 系统偏好设置->安全和隐私->有一个允许啥东西的,点击允许 3.再次安装vim tool 这样 安装完成之后再次重启,就ok了 分辨率自适应问题搞定