js代码转vue

js代码

< div class = "jumbotron" >
< h1 id = "step1" > HTML in tooltip </ h1 >
< p id = "step4" class = "lead" > We're going to use HTML codes in tooltips via Programmatic API </ p >
< a class = "btn btn-large btn-success" href = "javascript:void(0);" @click = " startIntro() " > Show me how </ a >
</ div >


// function startIntro(){
// var intro = introJs();
// intro.setOptions({
// steps: [
// {
// element: '#step1',
// intro: "This is a <b>bold</b> tooltip."
// },
// {
// element: '#step2',
// intro: "Ok, <i>wasn't</i> that fun?",
// position: 'right'
// },
// {
// element: '#step3',
// intro: 'More features, more <span style="color: red;">f</span><span style="color: green;">u</span><span style="color: blue;">n</span>.',
// position: 'left'
// },
// {
// element: '#step4',
// intro: "<span style='font-family: Tahoma'>Another step with new font!</span>",
// position: 'bottom'
// },
// {
// element: '#step5',
// intro: '<strong>Get</strong> it, <strong>use</strong> it.'
// }
// ]
// });

// intro.start();
// }



vue语法

< div class = "jumbotron" >
< h1 id = "step1" > HTML in tooltip </ h1 >
< p id = "step4" class = "lead" > We're going to use HTML codes in tooltips via Programmatic API </ p >
< a class = "btn btn-large btn-success" href = "javascript:void(0);" @click = " startIntro() " > Show me how </ a >
</ div >

import mintro from 'intro.js'
methods: {
startIntro() {
var introjs = mintro.introJs()
introjs.setOptions({
steps: [
{
element: '#step1' ,
intro: "This is a <b>bold</b> tooltip."
},
{
element: '#step2' ,
intro: "Ok, <i>wasn't</i> that fun?" ,
position: 'right'
},
{
element: '#step3' ,
intro: 'More features, more <span style="color: red;">f</span><span style="color: green;">u</span><span style="color: blue;">n</span>.' ,
position: 'left'
},
{
element: '#step4' ,
intro: "<span style='font-family: Tahoma'>Another step with new font!</span>" ,
position: 'bottom'
},
{
element: '#step5' ,
intro: '<strong>Get</strong> it, <strong>use</strong> it.'
}
]
});
introjs.start()
}
}
}
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值