mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs build
This commit is contained in:
parent
ea467a7f24
commit
fb4bd2eaea
@ -15,17 +15,17 @@ var renderVueTemplate = function (html, componentName) {
|
|||||||
decodeEntities: false,
|
decodeEntities: false,
|
||||||
lowerCaseAttributeNames: false,
|
lowerCaseAttributeNames: false,
|
||||||
lowerCaseTags: false
|
lowerCaseTags: false
|
||||||
})
|
});
|
||||||
|
|
||||||
var output = {
|
var output = {
|
||||||
style: $.html('style'),
|
style: $.html('style'),
|
||||||
script: $.html('script'),
|
script: $.html('script'),
|
||||||
'example-block': $.html('example-block')
|
'example-block': $.html('example-block')
|
||||||
}
|
};
|
||||||
var result
|
var result;
|
||||||
|
|
||||||
$('style').remove()
|
$('style').remove();
|
||||||
$('script').remove()
|
$('script').remove();
|
||||||
|
|
||||||
var script = '';
|
var script = '';
|
||||||
if (output.script) {
|
if (output.script) {
|
||||||
@ -38,7 +38,7 @@ var renderVueTemplate = function (html, componentName) {
|
|||||||
output.style + '\n' +
|
output.style + '\n' +
|
||||||
script;
|
script;
|
||||||
|
|
||||||
return result
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function convert(str) {
|
function convert(str) {
|
||||||
@ -79,7 +79,7 @@ for (var item in Components) {
|
|||||||
var content = parser.render(itemMd);
|
var content = parser.render(itemMd);
|
||||||
var result = renderVueTemplate(content, item);
|
var result = renderVueTemplate(content, item);
|
||||||
|
|
||||||
var exampleVueName = `${docsDir}/examples/${item}.vue`;
|
var exampleVueName = `${docsDir}/examples-dist/${item}.vue`;
|
||||||
|
|
||||||
if (!fs.existsSync(exampleVueName)) {
|
if (!fs.existsSync(exampleVueName)) {
|
||||||
fs.closeSync(fs.openSync(exampleVueName, 'w'));
|
fs.closeSync(fs.openSync(exampleVueName, 'w'));
|
||||||
|
@ -21,7 +21,7 @@ const registerRoute = (navConfig, isExample) => {
|
|||||||
route.push({
|
route.push({
|
||||||
path: '/component' + page.path,
|
path: '/component' + page.path,
|
||||||
component: function(resolve) {
|
component: function(resolve) {
|
||||||
require([isExample ? `./examples${page.path}.vue` : `./examples-docs${page.path}.md`], resolve);
|
require([isExample ? `./examples-dist${page.path}.vue` : `./examples-docs${page.path}.md`], resolve);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user