为什么 vue <template> 对 v-bind:src 无效?

Why is the vue <template> invalid with v-bind:src?

想动态切换html内容,所以用vue-loader src导入,但是v-bind:src根本不生效

<template src="./app.html"></template>

好的,有效

<template :src="getDOM(true)"></template>

getDOM(a){
        if(a){
            return './app.html'
        } else {
            return './app2.html'
        }
}

未激活。

那么,我该怎么做才能达到这个效果呢?

看来你需要使用Vue动态组件 https://vuejs.org/v2/guide/components.html#Dynamic-Components

您可以使用所需的不同模板制作几个组件,只需更改 is 属性。不要忘记导入需要的组件并注册它们。