반응형
Vue 및 Vue-tippy HTML 콘텐츠
안에 html 콘텐츠를 표시해야 합니다.vue-tippy
(데이터 바인딩 요소가 있는 경우 https://github.com/KABBOUCHI/vue-tippy)는 동작하지 않습니다.
<div id="demo">
<p>{{message}}</p>
<br />
<input v-model="message" title="Input">
<br />
Default example (it works)
<button title="Hi!" v-tippy> My Button! </button>
<br />
Data binding example (it not works)
<button title="{{ message }} " v-tippy> {{ message }} </button>
<br />
Data binding example (it works)
<button :title="message" v-tippy> {{ message }} </button>
<br />
Data binding example html content (it not works)
<button id="button3" v-tippy data-html="#contentpopup"> {{ message }} - html content </button>
<br />
<br />
<div id="contentpopup" style="background:red;">
<div>
{{ message }} - My html content
</div>
</div>
<br />
</div>
JS
var vueTippy = require('vue-tippy')
Vue.use(vueTippy)
var data = {
message: 'Hello Vue.js!'
}
var demo = new Vue({
el: '#demo',
data: data
})
어떻게 하면 고칠 수 있을까요?
고마워요.
HTML Template와 Vue Component 지원을 추가하였습니다.
vue-tippy 패키지를 최신 버전으로 업데이트하면 코드가 작동합니다.
예:
new Vue({
el: "#app",
data() {
return {
message: 'Hello Vue.js!'
}
}
})
.btn {
margin: 0;
color: white;
box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);
background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);
background: linear-gradient(135deg, #73a5ff, #5477f5);
letter-spacing: 0.5px;
font-family: inherit;
display: inline-block;
font-weight: 400;
line-height: 1.25;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid transparent;
padding: .5rem 1rem;
font-size: 1rem;
border-radius: .25rem;
-webkit-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.0/vue.min.js"></script>
<script src="https://kabbouchi.com/vue-tippy/vue-tippy.min.js"></script>
<div id="app">
<button class="btn" v-tippy data-distance="15" data-theme="light" data-animation="scale" data-arrowsize="big" data-trigger="click" data-interactive="true" data-animatefill="false" data-arrow="true" data-html="#contentpopup">
Popover HTML <small class="opacity-low">(click)</small>
</button>
<div id="contentpopup" style="display: none">
<div>
<h3> Header</h3>
<p style="color: black"> {{ message }} - data binding </p>
</div>
</div>
</div>
언급URL : https://stackoverflow.com/questions/44365008/vue-and-vue-tippy-html-content
반응형
'programing' 카테고리의 다른 글
vuex의 상태 변화를 동기적으로 감시하려면 어떻게 해야 합니까? (0) | 2022.07.16 |
---|---|
세그멘테이션 장애: 11 (0) | 2022.07.16 |
'마스크된' 비트셋 증가 (0) | 2022.07.16 |
사용자 지정 Vue-Cli 템플릿 내의 파일 이름 변경 (0) | 2022.07.16 |
C 매크로 정의는 다른 매크로를 참조할 수 있습니까? (0) | 2022.07.16 |