1.0.0 • Published 7 years ago
think-view-riot v1.0.0
node-html-builder
install
npm install think-view-riot
Usage
edit config file src/config/adapter.js
, add options:
const riot = require('think-view-riot');
exports.view = {
type: 'riot',
common: {
viewPath: path.join(think.ROOT_PATH, 'view'),
extname: '.tag',
sep: '/' //seperator between controller and action
},
riot: {
handle: riot
}
}
change options
change options:
```js
exports.view = {
type: 'riot',
riot: {
handle: riot,
options: {
title: 'xxx',
lang: 'zh-cn',
headScripts: [
'./test.js',
'<a></a>',
'<script src="./test4.js"></script>',
'<script>window._cc=1;</script>',
{
src: './test1.js',
props: ['async', 'type="module"', 'delay']
},
{
src: './test2.js'
}
],
bodyScripts: [
'./test3.js',
'./bundle.js'
],
metas: [
'<meta />',
{
name: 'author',
content: 'a'
},
{
name: 'description',
},
'<me',
{
name: 'window-target',
content: '_top'
},
{
name: 'charset',
content: 'utf-8'
}
],
links: [
'<link>',
'<a>',
'../t.css',
{
href: '../t2.css'
},
{
href: '../search.xml',
props: [
'rel="search"'
]
}
],
favicon: '../xx.ico'
layout: ''
}
}
}
1.0.0
7 years ago