Vue印刷ファイル(v-print)
3616 ワード
Vue v-print印刷ファイル.
インストールプラグインのダウンロード
登録の導入
app.jsまたはmain.jsに導入
使用
HTMLセクション
JS部
インストールプラグインのダウンロード
npm install vue-print-nb --save
登録の導入
app.jsまたはmain.jsに導入
//
import Print from 'vue-print-nb'
Vue.user(Print)
使用
HTMLセクション
<div id="single-info">
<el-form label-width="160px">
<el-row align="center" style="margin-top:30px;">
<el-col :span="24" align="center">
<el-button id="info-btn" v-print="'#single-info'" @click="prints"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
JS部
prints(){
var prints = document.getElementById('single-info');
prints.title = " ";
}