Open xgqfrms opened 5 years ago
url & path params
https://stackoverflow.com/questions/13702808/parent-window-open-child-window
https://developer.mozilla.org/en-US/docs/Web/API/Window/open https://developer.mozilla.org/en-US/docs/Web/API/Window/parent
// two new windows
window.open(`./select-tree.html#xxx`, `x`);
window.open(`./select-tree.html#yyy`, `y`);
// only one window
window.open(`./select-tree.html#aaa`, `c`);
window.open(`./select-tree.html#bbb`, `c`);
https://developer.mozilla.org/en-US/docs/Web/Events/readystatechange https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded
https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onhashchange
// <caption>版本信息</caption>
table = `
<table class="versions-table">
<colgroup>
<col width="20%">
<col width="30%">
<col width="40%">
<col width="10%">
</colgroup>
<thead>
<tr>
<th class="min-th">版本编号</th>
<th class="min-th">封版时间</th>
<th class="min-th">版本说明</th>
<th class="min-th">操作</th>
</tr>
</thead>
<tbody data-body="view-versions">${trs}</tbody>
</table>
`;
vue cli & 选中 option
分别对应 order
https://cli.vuejs.org/guide/creating-a-project.html#using-the-gui
$ vue ui
# http://localhost:8000/plugins
$ vue create vue-cli-app
# shit vue cli
$ npx vue-create vue-cli-app
vue-cli-app
# shit vue cli
$ cd vue-cli-app && yarn install
$ vue create vue-cli-app
# shit vue cli
$ npx vue-create vue-cli-app
https://github.com/zkat/npx/issues/112
https://cli.vuejs.org/guide/cli-service.html
https://blog.sourcerer.io/vue-cli-3-game-changer-or-barely-useful-82a025199957?gi=bf5bbec604aa https://medium.com/@almeynman/setup-vue-with-storybook-using-vue-cli-3-0-typescript-example-1be64a7cc7ac
old data === Object
new data === Function
父子组件通信 & props
for loop & unique key
call parent methods
Array.splice(index, 1)
css & scoped
scroped & css 代码冗余,无法复用
1.视频教程带你入门:初学者如果没有MVVM模式的基础学习Vue,可能初期切换思路有比较大的难度,这个时候可以借助视频教程辅助入门,而如果你对React或者Angular有过工作经验或者足够多的了解,那么可以省略这一步了,直接读官方文档会是更好的选择。
2.细读文档: Vue的官方文档上基本包含了Vue的所有知识点,文档看透,Vue也就掌握的很好了。
3.高级知识点深究:Vue中的一些难点,比如说服务器端渲染(SSR),预渲染,高级异步组件,递归组件,Vuex,vue-router,weex这样的内容,这个阶段需要把这些知识一一攻克。
4.源码阶段:到了这个阶段的同学,基本上可以游刃有余的使用Vue进行项目开发了,接下来就是深挖Vue的实现原理了,你可以通读Vue,Vuex,vue-router这些库的源码,做到从底层理解Vue的设计思路。
5.横向学习:当你从底层驾驭了Vue,是时候开始扩展你的只是广度了,你可以尝试学习React,Angular等其他框架,横向打通这些框架之间的关联:我们经常说某些框架好,某些框架不好,但是实际上如果你深入学习每个框架,它们都有自己优秀的设计理念和适用场景,只有你对每一个框架有了深入的理解后,才能够横向对比理解框架各自最大的优势。到时候,我相信大家也就不会随便喷其他框架了,Vue也可以用的炉火纯青了。
6.x (old)
https://yarnpkg.com/lang/en/docs/install/#centos-stable
$ curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
$ sudo yum install yarn
$ yarn -v
http://localhost:8000/project/select http://10.1.5.202:8000/project/select
http://localhost:8083/ http://10.1.5.202:8083/
$ vue create vue-cli-app
$ cd vue-cli-app
$ yarn serve
$ code add ./vue-cli-app
https://stackoverflow.com/questions/22764407/npm-install-goes-to-dead-in-china
$ npm config set registry https://registry.npmjs.org
C:\Users\xgqfrms\.npmrc
.npmrc
;;;;
; npm userconfig file
; this is a simple ini-formatted file
; lines that start with semi-colons are comments.
; read `npm help config` for help on the various options
;;;;
registry=https://registry.npmjs.org/
;;;;
; all options with default values
;;;;
; access=null
; allow-same-version=false
; always-auth=false
; also=null
; auth-type=legacy
; bin-links=true
; browser=null
; ca=null
; cafile=undefined
; cache=C:\Users\xgqfrms\AppData\Roaming\npm-cache
; cache-lock-stale=60000
; cache-lock-retries=10
; cache-lock-wait=10000
; cache-max=null
; cache-min=10
; cert=null
; cidr=null
; color=true
; depth=null
; description=true
; dev=false
; dry-run=false
; editor=notepad.exe
; engine-strict=false
; force=false
; fetch-retries=2
; fetch-retry-factor=10
; fetch-retry-mintimeout=10000
; fetch-retry-maxtimeout=60000
; git=git
; git-tag-version=true
; commit-hooks=true
; global=false
; globalconfig=C:\Users\xgqfrms\AppData\Roaming\npm\etc\npmrc
; global-style=false
; group=0
; ham-it-up=false
; heading=npm
; if-present=false
; ignore-prepublish=false
; ignore-scripts=false
; init-module=C:\Users\xgqfrms\.npm-init.js
; init-author-name=
; init-author-email=
; init-author-url=
; init-version=1.0.0
; init-license=MIT
; json=false
; key=null
; legacy-bundling=false
; link=false
; local-address=undefined
; loglevel=notice
; logs-max=10
; long=false
; maxsockets=50
; message=%s
; metrics-registry=null
; node-version=8.9.1
; offline=false
; onload-script=null
; only=null
; optional=true
; otp=0
; package-lock=true
; parseable=false
; prefer-offline=false
; prefer-online=false
; prefix=H:\Program Files\nodejs
; production=false
; progress=true
; proxy=null
; https-proxy=null
; user-agent=npm/{npm-version} node/{node-version} {platform} {arch}
; read-only=false
; rebuild-bundle=true
; registry=https://registry.npmjs.org/
; rollback=true
; save=true
; save-bundle=false
; save-dev=false
; save-exact=false
; save-optional=false
; save-prefix=^
; save-prod=false
; scope=
; script-shell=null
; scripts-prepend-node-path=warn-only
; searchopts=
; searchexclude=null
; searchlimit=20
; searchstaleness=900
; send-metrics=false
; shell=C:\WINDOWS\system32\cmd.exe
; shrinkwrap=true
; sign-git-tag=false
; sso-poll-frequency=500
; sso-type=oauth
; strict-ssl=true
; tag=latest
; tag-version-prefix=v
; timing=false
; tmp=C:\Users\xgqfrms\AppData\Local\Temp
; unicode=false
; unsafe-perm=true
; usage=false
; user=0
; userconfig=C:\Users\xgqfrms\.npmrc
; umask=0
; version=false
; versions=false
; viewer=browser
; _exit=true
; globalignorefile=C:\Users\xgqfrms\AppData\Roaming\npm\etc\npmignore
remove vue-cli
https://stackoverflow.com/questions/51615051/how-can-i-remove-vue-cli-2 https://docs.npmjs.com/getting-started/uninstalling-global-packages
https://docs.npmjs.com/cli/uninstall
$ npm uninstall vue-cli -g
$ npm uninstall @vue/cli -g
https://github.com/vuejs/ui https://vuejs.github.io/ui/#/ https://github.com/Akryum/vue-apollo
https://www.apollographql.com/
App.vue
webpack:///src/App.vue
<template>
<div id="app" class="app">
<ConnectionStatus v-if="ready" />
<div v-if="ready" class="content">
<router-view/>
</div>
<VueLoadingIndicator v-else class="app-init-loading overlay big accent"/>
<StatusBar/>
<ClientAddonLoader/>
<LocaleLoader/>
</div>
</template>
<script>
import i18n from './i18n'
export default {
metaInfo: {
titleTemplate: chunk => chunk ? `[Beta] ${chunk} - Vue CLI` : '[Beta] Vue CLI'
},
computed: {
ready () {
return Object.keys(i18n.getLocaleMessage('en')).length
}
}
}
</script>
<style lang="stylus">
@import "~@vue/ui/dist/vue-ui.css"
@import "~@/style/main"
</style>
<style lang="stylus" scoped>
@import "~@/style/imports"
.app
display flex
flex-direction column
.connection-status,
.status-bar
flex auto 0 0
.content
flex auto 1 1
height 100%
overflow hidden
.app-init-loading
z-index 100000
</style>
Yarn
https://cli.vuejs.org/guide/cli-service.html#configuration-without-ejecting
https://cli.vuejs.org/config/#global-cli-config
home path
C:\Users\xgqfrms.vuerc
{
"packageManager": "npm",
"useTaobaoRegistry": false,
"presets": {
"xgqfrms": {
"useConfigFiles": true,
"plugins": {
"@vue/cli-plugin-babel": {},
"@vue/cli-plugin-eslint": {
"config": "base",
"lintOn": [
"save"
]
}
}
},
"vue-cli-3.x": {
"useConfigFiles": true,
"plugins": {
"@vue/cli-plugin-babel": {},
"@vue/cli-plugin-pwa": {},
"@vue/cli-plugin-eslint": {
"config": "base",
"lintOn": [
"save"
]
}
},
"router": true,
"routerHistoryMode": true,
"vuex": true,
"cssPreprocessor": "sass"
}
}
}
namespaced: true
https://vuex.vuejs.org/zh/guide/modules.html#%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4
axios
https://www.imooc.com/article/252064
https://evenyao.com/ https://www.jianshu.com/p/b083b9f35bf8 https://www.jianshu.com/p/9b69ce6d9e9e
https://evenyao.github.io/Travel-Build/#/ https://github.com/evenyao/Travel
$ npm i -S axios
https://www.jianshu.com/p/c1f6b7718d6c https://www.jianshu.com/p/6c4bfe3dd0d8 https://github.com/ykloveyxk/vue-login https://ykloveyxk.github.io/2017/03/21/vue-login-%E9%80%9A%E8%BF%87%E4%B8%80%E4%B8%AA%E9%A1%B9%E7%9B%AE%E5%B8%A6%E4%BD%A0%E8%B5%B0%E8%BF%9Bvue%E5%85%A8%E6%A0%88%E5%BC%80%E5%8F%91/
vue & cli
https://cli.vuejs.org/
https://github.com/vuejs/vue-cli
vue +vuex+ vue-router+axios+elementUI
https://www.imooc.com/video/16985
install
https://cli.vuejs.org/guide/installation.html
vue 3.x