new Vue({
el: '#app',
data() {
return {
photo: 'https://himg2.huanqiucdn.cn/attachment2010/2019/0419/20190419120850374.jpg',
levelRange1: [
{name: '文字1'},
{name: '文字2', color: 'blue'}
],
level1: 1
}
}
})
<div id="app">
<h3>默认显示</h3>
<p>level控制当前头像显示在什么位置</p>
<ak-indicator :photo="photo" :level="-2"></ak-indicator>
<h3>自定义</h3>
<p>自定义危险等级、文字、颜色时没需要将side设置为custom。不然会使用默认的血压危险等级来显示</p>
<ak-indicator :photo="photo" :level="1" :level-range="levelRange1" side="custom"></ak-indicator>
</div>