vue源码哪里找?
1、安装vue之后在node_modules目录找到vue目录
2、github: https://github.com/vuejs/vue
下面内容仅个人理解,有错误或问题欢迎指正
这里只注释了src目录
|-- dist // 打包后的文件|-- src // 源码目录| |-- compiler // 模板编译| | |-- codegen // 渲染生成| | |-- directives // 指令| | └── parser // 模板解析| |-- core // 核心代码| | |-- components // 组件| | |-- global-api // 全局api| | |-- instance // 实例| | | └── render-helpers // 渲染助手| | |-- observer // 观察者(双向数据绑定)| | |-- util // 核心工具| | └── vdom // 虚拟DOM| | |-- helpers // 虚拟DOM助手| | └── modules // 虚拟DOM模块| |-- platforms // 平台| | |-- web // WEB端(PC或手机浏览器)| | | |-- compiler // web编译| | | |-- runtime // web运行时| | | |-- server // web服务器目录| | | └── util // 工具| | └── weex // 阿里开发高性能原生应用的框架| | |-- compiler // APP编译| | |-- runtime // APP运行时| | └── util // 工具| |-- server // 服务器端渲染(SSR=Server Side Render)| | |-- bundle-renderer // 打包渲染| | |-- optimizing-compiler // 优化编译器| | |-- template-renderer // 模板渲染| | └── webpack-plugin // webpack插件| |-- sfc // 解析SFC| | └── parser.js // 解板.vue文件| └── shared // 全局共享目录| |-- constants.js // 常量| └── util.js // 基础工具└── types // 静态类型
研究一个项目,我比较喜欢看看package.json,通过package.json我们可以看到这个项目用到了哪些工具,执行了哪些操作
从vue项目的package.json我们可以看到什么呢?
eslint+lint-staged检测代码规范、使用了flow静态类型检查http-server作为静态服务器karma+jasmine作为单元测试lodashpuppeteer+phantomjs来模拟浏览器rollup和webpack可能还有其他,没深探,如果你想成为前端“大牛”,上面的东西,你是否需要去了解熟悉呢?
{"name": "vue","version": "2.6.0-beta.2","description": "Reactive, component-oriented view layer for modern web interfaces.","main": "dist/vue.runtime.common.js","module": "dist/vue.runtime.esm.js","unpkg": "dist/vue.js","jsdelivr": "dist/vue.js","typings": "types/index.d.ts","files": ["src","dist/*.js","types/*.d.ts"],"sideEffects": false,"scripts": {"dev": "rollup -w -c scripts/config.js --environment TARGET:web-full-dev","dev:cjs": "rollup -w -c scripts/config.js --environment TARGET:web-runtime-cjs-dev","dev:esm": "rollup -w -c scripts/config.js --environment TARGET:web-runtime-esm","dev:test": "karma start test/unit/karma.dev.config.js","dev:ssr": "rollup -w -c scripts/config.js --environment TARGET:web-server-renderer","dev:compiler": "rollup -w -c scripts/config.js --environment TARGET:web-compiler ","dev:weex": "rollup -w -c scripts/config.js --environment TARGET:weex-framework","dev:weex:factory": "rollup -w -c scripts/config.js --environment TARGET:weex-factory","dev:weex:compiler": "rollup -w -c scripts/config.js --environment TARGET:weex-compiler ","build": "node scripts/build.js","build:ssr": "npm run build -- web-runtime-cjs,web-server-renderer","build:weex": "npm run build -- weex","test": "npm run lint && flow check && npm run test:types && npm run test:cover && npm run test:e2e -- --env phantomjs && npm run test:ssr && npm run test:weex","test:unit": "karma start test/unit/karma.unit.config.js","test:cover": "karma start test/unit/karma.cover.config.js","test:e2e": "npm run build -- web-full-prod,web-server-basic-renderer && node test/e2e/runner.js","test:weex": "npm run build:weex && jasmine JASMINE_CONFIG_PATH=test/weex/jasmine.js","test:ssr": "npm run build:ssr && jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.js","test:sauce": "npm run sauce -- 0 && npm run sauce -- 1 && npm run sauce -- 2","test:types": "tsc -p ./types/test/tsconfig.json","lint": "eslint src scripts test","flow": "flow check","sauce": "karma start test/unit/karma.sauce.config.js","bench:ssr": "npm run build:ssr && node benchmarks/ssr/renderToString.js && node benchmarks/ssr/renderToStream.js","release": "bash scripts/release.sh","release:weex": "bash scripts/release-weex.sh","release:note": "node scripts/gen-release-note.js","commit": "git-cz"},"gitHooks": {"pre-commit": "lint-staged","commit-msg": "node scripts/verify-commit-msg.js"},"lint-staged": {"*.js": ["eslint --fix","git add"]},"repository": {"type": "git","url": "git+https://github.com/vuejs/vue.git"},"keywords": ["vue"],"author": "Evan You","license": "MIT","bugs": {"url": "https://github.com/vuejs/vue/issues"},"homepage": "https://github.com/vuejs/vue#readme","devDependencies": {"@babel/core": "^7.0.0","@babel/plugin-proposal-class-properties": "^7.1.0","@babel/plugin-syntax-dynamic-import": "^7.0.0","@babel/plugin-syntax-jsx": "^7.0.0","@babel/plugin-transform-flow-strip-types": "^7.0.0","@babel/preset-env": "^7.0.0","@babel/register": "^7.0.0","@types/node": "^10.12.18","@types/webpack": "^4.4.22","acorn": "^5.2.1","babel-eslint": "^10.0.1","babel-helper-vue-jsx-merge-props": "^2.0.3","babel-loader": "^8.0.4","babel-plugin-istanbul": "^5.1.0","babel-plugin-transform-vue-jsx": "^4.0.1","babel-preset-flow-vue": "^1.0.0","buble": "^0.19.3","chalk": "^2.3.0","chromedriver": "^2.45.0","codecov": "^3.0.0","commitizen": "^2.9.6","conventional-changelog": "^1.1.3","cross-spawn": "^6.0.5","cz-conventional-changelog": "^2.0.0","de-indent": "^1.0.2","es6-promise": "^4.1.0","escodegen": "^1.8.1","eslint": "^5.7.0","eslint-plugin-flowtype": "^2.34.0","eslint-plugin-jasmine": "^2.8.4","file-loader": "^3.0.1","flow-bin": "^0.61.0","hash-sum": "^1.0.2","he": "^1.1.1","http-server": "^0.11.1","jasmine": "^2.99.0","jasmine-core": "^2.99.0","karma": "^3.1.1","karma-chrome-launcher": "^2.1.1","karma-coverage": "^1.1.1","karma-firefox-launcher": "^1.0.1","karma-jasmine": "^1.1.0","karma-mocha-reporter": "^2.2.3","karma-phantomjs-launcher": "^1.0.4","karma-safari-launcher": "^1.0.0","karma-sauce-launcher": "^2.0.2","karma-sourcemap-loader": "^0.3.7","karma-webpack": "^4.0.0-rc.2","lint-staged": "^8.0.0","lodash": "^4.17.4","lodash.template": "^4.4.0","lodash.uniq": "^4.5.0","lru-cache": "^5.1.1","nightwatch": "^0.9.16","nightwatch-helpers": "^1.2.0","phantomjs-prebuilt": "^2.1.14","puppeteer": "^1.11.0","resolve": "^1.3.3","rollup": "^1.0.0","rollup-plugin-alias": "^1.3.1","rollup-plugin-buble": "^0.19.6","rollup-plugin-commonjs": "^9.2.0","rollup-plugin-flow-no-whitespace": "^1.0.0","rollup-plugin-node-resolve": "^4.0.0","rollup-plugin-replace": "^2.0.0","selenium-server": "^2.53.1","serialize-javascript": "^1.3.0","shelljs": "^0.8.1","terser": "^3.10.2","typescript": "^3.1.3","webpack": "^4.22.0","weex-js-runtime": "^0.23.6","weex-styler": "^0.3.0","yorkie": "^2.0.0"},"config": {"commitizen": {"path": "./node_modules/cz-conventional-changelog"}}}
表格如果字段多,有横向滚动条是不是不方便?可拖拽的滚动是不是就方便了?
使用create-vue创建vue3项目,vite,vue3
相对VUE2 ,VUE3做了哪些优化和改进呢?
vue项目,不使用window.location.reload(),如何刷新当前页面?
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
vue2.0 v-html指令有潜在的xss风险,如何解决?
vue项目通过axios怎么下载二进制文件或图片?
ant.design UI框架 同时使用v-model或value属性时, placeholder不显示
如何在VUE项目中添加stylelint,检查css,scss,less的语法问题,保证团队代码的规范统一
VUE全局函数
定义了服务端渲染的属性名称常量SSR_ATTR,定义了一些资产类型常量ASSET_TYPES,定义了生命周期相关钩子函数的函数名称
使用iviewui-admin框架构建管理系统时,遇到的各类问题
vue项目中动态图片路径拼接
vue下filter方法的调用
21个vue顶级UI框架: Vuetify,Quasar,Vue Material,Keen-UI,Buefy,Bootstrap Vue,Muse-UI,AT-UI,Vux,iView,Uiv,Vuikit,Onsen UI+Vue,Semantic UI+Vue,Fish-UI,Mint UI,Framework7 Vue,Cube UI,Vueblu,Ant Design Vue
".vue"文件是如何解析成js对象的~
立个flag,看过年这段时间能不能把vue的源码读完?多年前看过jQuery的部分源码,如果想要更深入的了解vue,还是得从源码开始
vue源码阅读,慢慢学习
vue的生命周期函数
vue组件的数据data为什么一定要是函数 ?
Mint-ui this.$messagebox点取消时,报错:Uncaught (in promise) cancel
vue-validate使用
这就是个vue的坑。。。
vue如何监听enter事件?
vue使用axios进行form表单提交
vue中如何改变title标题
如果在vue2.0中使用NProgress进度条
Axios 是一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中。也是vue2.0官方推荐的,同时不再对vue-resource(vue1.0使用)进行更新和维护
分析Vue.js源码
npm run dev模式下,webpack4+vue2项目下,类似'/user/login'二级路由,刷新时静态资源路径不对,静态资源返回404
[Vue warn]: Error in render: "TypeError: Cannot read property 'matched' of undefined"
did you register the component correctly? For recursive components, make sure to provide the "name" option
vue.js如何查看注册了哪些组件,获取组件名称
vue底层的Virtual DOM就是基于snabbdom修改的