vuejs2

Migrating “slot” deprecated syntax

两盒软妹~` 提交于 2021-02-17 03:10:23
问题 I'm running on vue.js 2.6.1 the current code (written by a co-worker who's not around anymore) He used the 'scope' directive with the following deprecated syntax <template slot="HEAD[epc]" slot-scope="data"> <div> <p class="column-title">{{data.label}}</p> <p class="explanation-text">{{data.field.explanation}}</p> </div> </template> I want to access the slot-scope "data" prop but I want to migrate the old syntax onto a new one the documentation fails to explain how. also, I tried changing the

Migrating “slot” deprecated syntax

非 Y 不嫁゛ 提交于 2021-02-17 03:10:18
问题 I'm running on vue.js 2.6.1 the current code (written by a co-worker who's not around anymore) He used the 'scope' directive with the following deprecated syntax <template slot="HEAD[epc]" slot-scope="data"> <div> <p class="column-title">{{data.label}}</p> <p class="explanation-text">{{data.field.explanation}}</p> </div> </template> I want to access the slot-scope "data" prop but I want to migrate the old syntax onto a new one the documentation fails to explain how. also, I tried changing the

Migrating “slot” deprecated syntax

被刻印的时光 ゝ 提交于 2021-02-17 03:09:37
问题 I'm running on vue.js 2.6.1 the current code (written by a co-worker who's not around anymore) He used the 'scope' directive with the following deprecated syntax <template slot="HEAD[epc]" slot-scope="data"> <div> <p class="column-title">{{data.label}}</p> <p class="explanation-text">{{data.field.explanation}}</p> </div> </template> I want to access the slot-scope "data" prop but I want to migrate the old syntax onto a new one the documentation fails to explain how. also, I tried changing the

VueJS with normal JavaScript

泪湿孤枕 提交于 2021-02-16 07:54:53
问题 I want to add count down timer to my vue component. I have found a script which is written in normal JavaScript. this is my JavaScript file. var upgradeTime = 7200; var seconds = upgradeTime; function timer() { var days = Math.floor(seconds/24/60/60); var hoursLeft = Math.floor((seconds) - (days*86400)); var hours = Math.floor(hoursLeft/3600); var minutesLeft = Math.floor((hoursLeft) - (hours*3600)); var minutes = Math.floor(minutesLeft/60); var remainingSeconds = seconds % 60; if

File input on change in vue.js

你说的曾经没有我的故事 提交于 2021-02-15 08:20:51
问题 Using plain HTML/JS, it is possible to view the JavaScript File objects of selected files for an input element like so: <input type="file" id="input" multiple onchange="handleFiles(this.files)"> However, when converting it to the 'Vue' way it doesn't seem to work as intend and simply returns undefined instead of returning an Array of File objects. This is how it looks in my Vue template: <input type="file" id="file" class="custom-file-input" v-on:change="previewFiles(this.files)" multiple>

File input on change in vue.js

微笑、不失礼 提交于 2021-02-15 08:20:39
问题 Using plain HTML/JS, it is possible to view the JavaScript File objects of selected files for an input element like so: <input type="file" id="input" multiple onchange="handleFiles(this.files)"> However, when converting it to the 'Vue' way it doesn't seem to work as intend and simply returns undefined instead of returning an Array of File objects. This is how it looks in my Vue template: <input type="file" id="file" class="custom-file-input" v-on:change="previewFiles(this.files)" multiple>

this.$refs[(“p” + index)].focus is not a function

左心房为你撑大大i 提交于 2021-02-15 06:18:24
问题 I'd like to turn a div into input box on click, so that the post (which is rendered inside a loop) can be edited. Here is the button on the post: <a @click="setFocusEdit(index)" v-if="isAuthor(post)" href="#" >Edit Me</a> And the div concerned: <div :ref="'p' + index" class="post-description"> {{post.description}} </div> The method: setFocusEdit(index) { console.log('focusing on', index); this.$refs['p' + index].focus(); }, But I get this error: Uncaught TypeError: this.$refs[("p" + index)]

this.$refs[(“p” + index)].focus is not a function

ぐ巨炮叔叔 提交于 2021-02-15 06:18:20
问题 I'd like to turn a div into input box on click, so that the post (which is rendered inside a loop) can be edited. Here is the button on the post: <a @click="setFocusEdit(index)" v-if="isAuthor(post)" href="#" >Edit Me</a> And the div concerned: <div :ref="'p' + index" class="post-description"> {{post.description}} </div> The method: setFocusEdit(index) { console.log('focusing on', index); this.$refs['p' + index].focus(); }, But I get this error: Uncaught TypeError: this.$refs[("p" + index)]

Understanding how to use pagination in Bootstrap-vue

こ雲淡風輕ζ 提交于 2021-02-11 18:22:39
问题 I have written the following code: <div> <div id="app" class="container"> <div class="grid"> <article v-for="tool in tools"> <div class="title"> <h3>{{capitalizeFirstLetter(tool.name)}}</h3> </div> <div class="description"> {{tool.description}} </div> <br> <div> <toggle-button :value=tool.status color="#82C7EB" :width=100 :height=30 :sync="true" :labels="{checked: 'Following', unchecked: 'Unfollowing'}" @change="onChange(tool)"/> </div> </article> </div> </div> </div> Recently I started using

How properly to use bootstrap-vue's panel?

本小妞迷上赌 提交于 2021-02-11 13:34:41
问题 I'm trying to migrate my project from vue-strap to bootstrap-vue. I have trouble to migrate panel. The current vue-strap code: <div class="col-sm-3"> <panel is-open type="info"> <table slot="header"><th>Search:</th></table> <search-form :fieldList="fieldList" :customs-max-num="customsMaxNum" :data-types="dataTypes" /> </panel> </div> The search-form is my component. As I understand, I need to use the collapse of bootstrap-vue (without actually collapsing), as shown in the docs. But it looks