重构2.0

master
yutent 2023-10-27 19:18:41 +08:00
parent 9b00dc971f
commit 95f088475e
1 changed files with 6 additions and 7 deletions

View File

@ -6,13 +6,13 @@
import Smarty from 'smartyx' import Smarty from 'smartyx'
export default { export function createViewsPlugin() {
name: 'views', return {
install() { name: 'views',
var eng = new Smarty() install() {
var conf = this.get('views') let eng = new Smarty()
let conf = this.get('views')
if (conf.enabled) {
if (conf.dir) { if (conf.dir) {
eng.config('path', conf.dir) eng.config('path', conf.dir)
@ -24,6 +24,5 @@ export default {
throw new Error('views.dir is empty') throw new Error('views.dir is empty')
} }
} }
return Object.create(null)
} }
} }