vue-component

Using different text values with vuetify component

喜欢而已 提交于 2019-12-11 05:26:12
问题 I'm interested in using a vuetify expansion panel component in a nuxt project. I'm looking at https://vuetifyjs.com/en/components/expansion-panels#examples . The exampleas all show the same text and header for each subpanel based on code that looks like: <v-app id="inspire"> <div> <div class="text-xs-center mb-3">{{ panel }}</div> <v-expansion-panel v-model="panel" expand > <v-expansion-panel-content v-for="(item, i) in 5" :key="i" > <div slot="header">Item</div> <v-card> <v-card-text class=

Conditionally bind custom-directives in vue js for 'clicking outside an element event'

狂风中的少年 提交于 2019-12-11 04:58:18
问题 References Add vue directive on condition Detect click outside element I am writing a custom directive for 'click-outside senario' for a list of elements. Basically when a button is clicked on a item in the list it goes into selected mode . Now if a click occurs anywhere else I need to cancel selection mode . For that I need to detect click outside . I figured out the directive for it from For that I have come up with const clickOutside = { bind: function (el, binding, vnode) { console.log(

How can I change format datetime to date in vue component?

筅森魡賤 提交于 2019-12-11 04:47:32
问题 My vue component like this : <template> ... <td>{{getDate(item.created_at)}}</td> ... </template> <script> export default { ... methods: { getDate(datetime) { let date = new Date(datetime).toJSON().slice(0,10).replace(/-/g,'/') return date } } } </script> If I console.log(datetime) , the result : 2018-03-31 18:23:20 I want to get only date and change the format to be : 31 Mar 2018 I try like my component above, but the result like this : 2018/03/31 I try use format method and dateformat

How can I add scrollbar vertical in the modal dialog on the vuetify?

心不动则不痛 提交于 2019-12-11 04:33:45
问题 My code like this : <div id="app"> <v-app> <v-content> <v-container> <v-dialog v-for='foo, k in foos' :key='foo.id' :close-on-content-click="false" transition="scale-transition" :return-value.sync="foo.date" min-width="290px" v-model="modal[k]" :ref="'dialog' + k" > <template v-slot:activator="{ on }"> <v-btn color="success" dark v-on="on">call date {{foo.id}} {{ foo.date }}</v-btn> </template> <v-row justify="center"> <v-date-picker v-model="foo.date" @input="changeHours"> <div class="flex

What is the tag name of class based vue component

六月ゝ 毕业季﹏ 提交于 2019-12-11 04:13:34
问题 Refer to the link below, we can use class based vue component which is written in TypeScript. What is the correct way to use these custom components? For example, the Es5 code below defines a component which can be used in other components' template like <my-component></my-component> because we put a name 'my-component' as a parameter to Vue.component method. How to achieve this in typescript? Vue.component('my-component', { template: '<span>{{ message }}</span>', data: { message: 'hello' } }

How to properly pass data from child to parent and parent to child component?

扶醉桌前 提交于 2019-12-11 04:12:54
问题 First of all, this is my current structure CHILD COMPONENT // HTML <v-select v-bind:items="selectItems" v-model="selectedItem" label="Category" item-value="text" ></v-select> <v-text-field label="Enter Value" type="number" v-model="compVal" ></v-text-field> // JS props: { selectItems: { type: Array, required: true }, selectedItem: { type: String }, compVal: { type: Number }, } PARENT COMPONENT // HTML <component :selecItems="selectOneItems" :selectedItem="selectOneItem" :compVal="compOneVal">

A simple datepicker in VueJS

扶醉桌前 提交于 2019-12-11 04:08:42
问题 I want to make a datetimepicker in a components input tag. I have implemented bootstrap-datetimpicker but when i choose date i cant get input value in the components methods( here is an example: https://jsfiddle.net/ma9sgnd8/1/ new Vue({ el: '#app', data: { date: '' }, mounted: function() { var args = { format: 'MM/DD/YYYY' }; this.$nextTick(function() { $('.datepicker').datetimepicker(args) }); this.$nextTick(function() { $('.time-picker').datetimepicker({ format: 'LT' }) }); } }) 回答1: Turns

Resizable Vue-good-table or Vue

£可爱£侵袭症+ 提交于 2019-12-11 03:51:56
问题 I have a table make with Vue-good-table in Vue.js. I need to find a way for do it resizable. Something like this. https://codepen.io/validide/pen/aOKLNo Unfortunately, Vue-good-table do not have this option, far as I know. https://github.com/xaksis/vue-good-table/issues/226 I tested with JQuery, but I do not want mix Jquery and Vue, and I do not know if a library in Jquery, it will work with this component. I tested but I did not find any. There is another way in Javascript/css or Vue for do

Append dynamic vue component after specific element

夙愿已清 提交于 2019-12-11 03:49:20
问题 I want to add component in random position (not random actually, based on some logic) based on click of other elements. In jQuery, we can achieve that by $('#someId').append('element') or by $('#someId').find('.someClass').after('element') What I want achieve (jquery version): jsfiddle How to do that in Vue ? N.B: This couldn't be achieved by v-for as all elements won't appear sequentially or in the same place. Also, components should not be appeared on initialization as this is dynamic. 回答1:

passing data from child to parent component in Vue

时光毁灭记忆、已成空白 提交于 2019-12-11 03:39:24
问题 I am practicing Vue JS and would like to understand how to pass data from a child component to a parent component emitting an event. This is my parent component BookList: <template> <div class="booklist"> <BookForm @book-is-created="onClickForm" /> <table v-for="book in books"> <tr> <th> Author </th> <th> Title </th> <th> Publishing House </th> <th> Edition Date </th> </tr> <tr> <td> {{ book.author}}</td> <td> {{ book.title}}</td> <td> {{ book.publishing_house}}</td> <td> {{ book.edition_date