Comments (8)
vue-loader 15 的逻辑重构了,不过用下面的用法兼容
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
entry: './index.js',
output: {
filename: 'out.js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
// 👇
{
test: /\.md$/,
loaders: ['vue-loader', 'vue-markdown-loader/lib/markdown-compiler.js']
}
// 👆
]
},
plugins: [
new VueLoaderPlugin()
]
}
调整下,应该是下面这样
{
test: /\.md$/,
use: [
{
loader: 'vue-loader'
},
{
loader: 'vue-markdown-loader/lib/markdown-compiler',
options: {
raw: true
}
}
]
}
from vue-markdown-loader.
可是这样的话。vue-markdown-loader 的 options 怎么设置
from vue-markdown-loader.
看来要大神来解决下了
from vue-markdown-loader.
看来这个包已经放弃维护了
from vue-markdown-loader.
放弃维护了么
from vue-markdown-loader.
希望能给出解决方案, 想用vue-cli 3.0的版本创建项目
from vue-markdown-loader.
使用 vue-md-loader 吧
from vue-markdown-loader.
可是这样的话。vue-markdown-loader 的 options 怎么设置
{
test: /\.md$/,
use: [
{
loader: 'vue-loader'
},
{
loader: 'vue-markdown-loader/lib/markdown-compiler',
options: {
raw: true,
preventExtract: true,
use: [
[
require('markdown-it-container'),
'demo',
{
validate: function(params) {
return params.trim().match(/^demo\s+(.*)$/)
},
render: function(tokens, idx) {
if (tokens[idx].nesting === 1) {
// 1.获取第一行的内容使用markdown渲染html作为组件的描述
let demoInfo = tokens[idx].info
.trim()
.match(/^demo\s+(.*)$/)
let description =
demoInfo && demoInfo.length > 1 ? demoInfo[1] : ''
let descriptionHTML = description
? markdownRender.render(description)
: ''
// 2.获取代码块内的html和js代码
let content = tokens[idx + 1].content
// 3.使用自定义开发组件【DemoBlock】来包裹内容并且渲染成案例和代码示例
return `<demo-block>
<div class="source" slot="source">${content}</div>
${descriptionHTML}
<div class="highlight" slot="highlight">`
} else {
return '</div></demo-block>\n'
}
}
}
]
]
}
}
]
}
from vue-markdown-loader.
Related Issues (20)
- HTML self-closing tags aren't handled correctly HOT 1
- md文件顶部插入style问题 HOT 2
- Unknown custom element: <type>
- md 插入 script 解析error HOT 1
- 组件emit的方法驼峰命名时,在md中使用无法监听到该事件 HOT 1
- Cannot read property '__vueMarkdownOptions__' of undefined HOT 7
- markdown 转 vue Syntax Error HOT 1
- chainWebpack configuration breaks Vuetify integration HOT 3
- 可以正常编译浏览,但是打包报错
- 项目打包build到一半就卡住不动了,显示Building for production...
- 如何获取md文件内容
- Error: [VueLoaderPlugin Error] No matching use for vue-loader is found.
- Line breaks & ul,li indentation removed? HOT 1
- linux环境打包失败,本地打包可以 node版本一致
- markdown-it-emoji怎么在Vue CLI 3的vue.config.js file中配置
- Usage of highlight.js triggers deprecation note
- [feat]希望支持给cheerio配置参数
- 支持vue3吗?
- npm audit severity: moderate
- .md文件中html标记的代码块中的style会被项目全局加载?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-markdown-loader.