重构2.0
parent
9b00dc971f
commit
95f088475e
13
index.js
13
index.js
|
@ -6,13 +6,13 @@
|
|||
|
||||
import Smarty from 'smartyx'
|
||||
|
||||
export default {
|
||||
name: 'views',
|
||||
install() {
|
||||
var eng = new Smarty()
|
||||
var conf = this.get('views')
|
||||
export function createViewsPlugin() {
|
||||
return {
|
||||
name: 'views',
|
||||
install() {
|
||||
let eng = new Smarty()
|
||||
let conf = this.get('views')
|
||||
|
||||
if (conf.enabled) {
|
||||
if (conf.dir) {
|
||||
eng.config('path', conf.dir)
|
||||
|
||||
|
@ -24,6 +24,5 @@ export default {
|
|||
throw new Error('views.dir is empty')
|
||||
}
|
||||
}
|
||||
return Object.create(null)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue