From 95f088475e49cd18206c7f4d7f939d433df34f02 Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 27 Oct 2023 19:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=842.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 35896d2..fca9768 100644 --- a/index.js +++ b/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) } }