vue+webpack添加对pug的支持
// 安装pug和加载器 yarn add pug-loader pug-plain-loader pug --dev
// webpack.config.js中 添加规则 { test: /\.pug$/, use: ['pug-plain-loader'] }
使用
<template lang="pug"> div </template> <script> export default {} </script> <style> </style>
如果不装pug-plain-loader会报错:
Component template requires a root element, rather than just text.
参考:https://***.com/questions/51073702/vue-pug-language-has-not-been-recognized-in-vue-template
原文链接:https://www.cnblogs.com/saving/p/10108068.html
本文来源 爱码网,其版权均为 原网址 所有 与本站无关,文章内容系作者个人观点,不代表 本站 对观点赞同或支持。如需转载,请注明文章来源。
© 版权声明
文章版权归作者所有,未经允许请勿转载。