為什么<templete>標(biāo)簽里要再放一個(gè)常規(guī)標(biāo)簽(比如div標(biāo)簽),下面這段代碼才不會(huì)出錯(cuò)要這樣寫<templete><div><el-button?type="text"?@click="centerDialogVisible?=?true">點(diǎn)擊打開?Dialog</el-button><el-dialog??title="提示"??:visible.sync="centerDialogVisible"??width="30%"??center>??<span>需要注意的是內(nèi)容是默認(rèn)不居中的</span>??<span?slot="footer"?class="dialog-footer">????<el-button?@click="centerDialogVisible?=?false">取?消</el-button>????<el-button?type="primary"?@click="centerDialogVisible?=?false">確?定</el-button>??</span></el-dialog></div></templete>而不是這樣寫吶<templete><el-button?type="text"?@click="centerDialogVisible?=?true">點(diǎn)擊打開?Dialog</el-button><el-dialog??title="提示"??:visible.sync="centerDialogVisible"??width="30%"??center>??<span>需要注意的是內(nèi)容是默認(rèn)不居中的</span>??<span?slot="footer"?class="dialog-footer">????<el-button?@click="centerDialogVisible?=?false">取?消</el-button>????<el-button?type="primary"?@click="centerDialogVisible?=?false">確?定</el-button>??</span></el-dialog></templete>
vue.js中<templete>標(biāo)簽的用法?
Jenny_xiong
2018-04-27 15:53:31