参考: https://www.cnblogs.com/springlight/p/5782637.html
关键:使用转译字符 \ 来转译引号
方法一. 直接传递:
var tem = "<p @click='fun1(\'这里是传递的字符串\') '></p>"
方法二. 字符串变量型
var str = '111'
var tem = "<p @click='fun1(\'"+ stringParam +"\') '></p>"
参考: https://www.cnblogs.com/springlight/p/5782637.html
关键:使用转译字符 \ 来转译引号
方法一. 直接传递:
var tem = "<p @click='fun1(\'这里是传递的字符串\') '></p>"
方法二. 字符串变量型
var str = '111'
var tem = "<p @click='fun1(\'"+ stringParam +"\') '></p>"