axios post默認(rèn)參數(shù)格式為字符串,你可以用axios請求攔截器對post請求的參數(shù)做下處理
無限循環(huán)啊 不要在模板里面改變數(shù)據(jù) 因?yàn)楦淖償?shù)據(jù)會更新模板eventsList.reverse()改變了原數(shù)組eventsList ==> 觸發(fā)更新 ==> eventsList.reverse()==>觸發(fā)更新
可以用computed
<div class="eventItem" v-for="(item,index) in usersReverse" :key="index"></div>
computed: {
usersReverse: function () {
return this.users.reverse();
}
}webpack.base.conf.js
entry: {
app: './src/main.js'
}
.babelrc
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime","transform-decorators-legacy"]
}
vue-shims.d.ts
declare module "*.vue" {
import Vue from 'vue';
export default Vue;
}
main.js文件不變
tsconfig.json
{
"compilerOptions": {
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"module": "es2015",
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"strict": true,
"target": "es5",
"moduleResolution": "node",
"lib": [
"dom",
"es5",
"es2017",
"es2015"
]
}
}
App.vue
<template>
<div>
<input v-model="msg">
<p>prop: {{propMessage}}</p>
<p>msg: {{msg}}</p>
<p>helloMsg: {{helloMsg}}</p>
<p>computed msg: {{computedMsg}}</p>
<button @click="greet">Greet</button>
</div>
</template>
<script>
import Vue from 'vue'
import Component from 'vue-class-component'
@Component({
props: {
propMessage: String
}
})
export default class App extends Vue {
// initial data
msg = 123
// use prop values for initial data
helloMsg = 'Hello, ' + this.propMessage
// lifecycle hook
mounted () {
this.greet()
}
// computed
get computedMsg () {
return 'computed ' + this.msg
}
// method
greet () {
alert('greeting: ' + this.msg)
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
package.json
"dependencies": {
"awesome-typescript-loader": "^3.4.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"node-sass": "^4.7.2",
"sass": "^1.0.0-beta.4",
"sass-loader": "^6.0.6",
"sass-resources-loader": "^1.3.1",
"source-map-loader": "^0.2.3",
"ts-loader": "^3.3.1",
"typescript": "^2.6.2",
"vue": "^2.5.2",
"vue-class-component": "^6.1.2",
"vue-router": "^3.0.1"
},
<el-form-item label="temp">
<span slot="label">Label for the slot</span>
<el-input v-model="formLabelAlign.name"></el-input>
</el-form-item>
// index.js
console.log(process.argv);
package.json
"build": "node index.js"
npm run build -- --name hello
打印的結(jié)果是
[ '/usr/local/bin/node',
'/Users/ltaoo/Documents/nodejs/args/index.js',
'--name',
'hello' ]
參考
想要刷新子組件的評論?很簡單,評論是由數(shù)據(jù)顯示的,如果你數(shù)據(jù)變了自然評論也會變,
這樣你就可以在子組件watch會變的數(shù)據(jù)
如果你的數(shù)據(jù)是在子組件獲取到的,那么也可以在把獲取的方法寫在computed中,只要數(shù)據(jù)源變了同樣也會獲取
async和await傳一個隱性Promise可以解決雙重回調(diào)問題
有默認(rèn)顏色選項(xiàng)的,你這樣設(shè)置有報(bào)錯嗎?
canvas.selections=false//取消框選
object.set('selectable',false)//單個元素禁止選中
提供一個思路,給 + 按鈕添加點(diǎn)擊事件 更改 + 按鈕的背景顏色以及寬高 ,+ 按鈕的里面包裹著登錄框的信息,只不過通過alpha 隱藏了,然后點(diǎn)擊事件會讓登錄框信息顯示,然后最重要的是給 + 按鈕添加css的 transition 屬性就好了,我去寫一個試試
命令行移到單獨(dú)的包了,npm install -g webpack-cli
str === 'true'
或者
str === 'true' ? true : str === 'false' ? false : '我也不知道是什么鬼'
Array.prototype.reduce 了解一下。
array.reduce((resp, obj)=> {
var originObj = resp.find(item => item.key === obj.key);
if (originObj) {
originObj.value+= obj.value;
} else {
resp.push(obj)
}
return resp;
}, [])Sequelize
你的函數(shù)沒有返回值。
function debounceTrigger() {
return debounce(function() {
output2.value = (input2.value || '').toUpperCase();
},
500)
}
input2.addEventListener('input', debounceTrigger());北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。