如题,vue项目中引入了这个打印插件,但在js中调用相关方法中,一直报错,this.$print is not a function,求教怎么解决。
在main.js中引入也是正常的
import Print from 'vue-print-nb'
Vue.use(Print) // 注册
其他使用方式,像以下这种,都是可以正常打印的。但因为要在js中调一些设置,所以页面直接打印的话,不太方便。
<div id="printMe" >
<p>打印内容</p>
</div>
<button v-print="'#printMer'">打印</button>
求指教!