8000 fragment · bencode/vue@8f3d06e · GitHub
[go: up one dir, main page]

Skip to content

Commit 8f3d06e

Browse files
committed
fragment
1 parent 640027c commit 8f3d06e

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/fragment/factory.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
var _ = require('../util')
21
var compiler = require('../compiler')
2+
import { isTemplate } from '../util'
33
import { parseTemplate, cloneNode } from '../parsers/template'
4-
var Fragment = require('./fragment')
5-
var Cache = require('../cache')
6-
var linkerCache = new Cache(5000)
4+
import Fragment from './fragment'
5+
import Cache from '../cache'
6+
7+
const linkerCache = new Cache(5000)
78

89
/**
910
* A factory that can be used to create instances of a
@@ -13,11 +14,11 @@ var linkerCache = new Cache(5000)
1314
* @param {Element|String} el
1415
*/
1516

16-
function FragmentFactory (vm, el) {
17+
export default function FragmentFactory (vm, el) {
1718
this.vm = vm
1819
var template
1920
var isString = typeof el === 'string'
20-
if (isString || _.isTemplate(el)) {
21+
if (isString || isTemplate(el)) {
2122
template = parseTemplate(el, true)
2223
} else {
2324
template = document.createDocumentFragment()
@@ -52,5 +53,3 @@ FragmentFactory.prototype.create = function (host, scope, parentFrag) {
5253
var frag = cloneNode(this.template)
5354
return new Fragment(this.linker, this.vm, frag, host, scope, parentFrag)
5455
}
55-
56-
module.exports = FragmentFactory

src/fragment/fragment.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
* @param {Object} [scope]
2424
*/
2525

26-
function Fragment (linker, vm, frag, host, scope, parentFrag) {
26+
export default function Fragment (linker, vm, frag, host, scope, parentFrag) {
2727
this.children = []
2828
this.childFrags = []
2929
this.vm = vm
@@ -193,5 +193,3 @@ function detach (child) {
193193
child._callHook('detached')
194194
}
195195
}
196-
197-
module.exports = Fragment

0 commit comments

Comments
 (0)
0