|
|
@@ -1,4 +1,5 @@
|
|
|
var _ = require('../util')
|
|
|
+var compile = require('../compile/compile')
|
|
|
var templateParser = require('../parse/template')
|
|
|
|
|
|
module.exports = {
|
|
|
@@ -15,21 +16,15 @@ module.exports = {
|
|
|
partial = templateParser.parse(partial, true)
|
|
|
var el = this.el
|
|
|
var vm = this.vm
|
|
|
- // comment ref node means inline partial
|
|
|
if (el.nodeType === 8) {
|
|
|
- // keep a ref for the partial's content nodes
|
|
|
- var nodes = _.toArray(partial.childNodes)
|
|
|
+ // comment ref node means inline partial
|
|
|
+ compile(partial, vm.$options)(vm, partial)
|
|
|
_.replace(el, partial)
|
|
|
- // compile partial after appending, because its
|
|
|
- // children's parentNode will change from the fragment
|
|
|
- // to the correct parentNode. This could affect
|
|
|
- // directives that need access to its element's
|
|
|
- // parentNode.
|
|
|
- nodes.forEach(vm._compileNode, vm)
|
|
|
} else {
|
|
|
// just set innerHTML...
|
|
|
el.innerHTML = ''
|
|
|
el.appendChild(partial)
|
|
|
+ compile(el, vm.$options, true)(vm, el)
|
|
|
}
|
|
|
}
|
|
|
|