Skip to content

Commit

Permalink
feat: progress with popper.js tooltip rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Amirah Chamble authored and Amirah Chamble committed Jun 25, 2019
1 parent 4868387 commit 5a44292
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dev/views/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
justify-content="between"
>
<FishTankTooltip
orientation="top"
orientation='top'
placeholder="a top oriented Tooltip"
>
<a href="#"><FishTankText color="link" semiBold
Expand Down
23 changes: 11 additions & 12 deletions src/components/FishTankTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@mouseleave="destroyPop"
>
<slot/>
<div class="content">{{placeholder}}</div>
</div>
</template>

Expand All @@ -21,20 +22,16 @@ export default Vue.extend({
FishTankText
},
props: {
placeholder: String,
orientation: String
},
data(){
return{
// focus: Boolean,
popObj: undefined,
inputEl: undefined,
slot: undefined,
placeholder: String,
orientation: {
type: String,
required: false,
default: 'top'
},
content: undefined,
}
},
Expand All @@ -46,13 +43,15 @@ export default Vue.extend({
console.log("true")
this.$data.inputEl = document.querySelector('.popper')
this.$data.slot = document.querySelector('slot')
this.$data.content = document.querySelector('.content')
let popperLocation = this.$props.orientation
console.log(this.$props.placeholder)
this.$data.popObj = new Popper(this.$data.inputEl, this.$data.placeholder,{
placement: this.$data.orientation,
this.$data.popObj = new Popper(this.$data.inputEl, this.$data.content,{
placement: popperLocation,
modifiers:{
computeStyle:{
gpuAcceleration:true
// gpuAcceleration:true
},
offset:{
offset:4
Expand Down

0 comments on commit 5a44292

Please sign in to comment.