vue-component

Vue Transition not Triggering on button click

风流意气都作罢 提交于 2019-11-28 08:48:00
问题 I am new to Vue JS and I am creating a thumbnail viewer wherein I'll be getting a list of images and videos as an array of objects. At first, I will be showing just 5 items and when the user clicks Top / Bottom button, I want to slide the thumbnails vertically. I have created a codepen by referring some links on StackOverflow. I am using Vue Transitions and my data seems to be reactive but somehow I can't see the smooth transition (sliding to the top / bottom by 100px) when I click on the Top

How to solve [Vue warn]: Avoid mutating a prop directly since the value will be overwritten on vue.js 2?

萝らか妹 提交于 2019-11-28 08:33:13
问题 My view is like this : <div class="col-md-8"> ... <star :value="{{ $data['rating'] }}"></star> ... </div> My star component is like this : <template> <span class="rating" :class='{"disable-all-rating": !!value}'> <template v-for="item in items"> <label class="radio-inline input-star" :class="{'is-selected': ((starValue>= item.value) && starValue!= null)}"> <input type="radio" class="input-rating" v-model="starValue" @click="rate(item.value)"> </label> </template> </span> </template> <script>

One global data structure in Vue.js [duplicate]

别说谁变了你拦得住时间么 提交于 2019-11-28 08:31:09
问题 This question already has answers here : Global data with VueJs 2 (2 answers) Closed 2 years ago . I am building a single page app with Vue.js. It's a relatively simple app, more like an extended, opinionated spreadsheet. I'm using vue-router to handle different views of the app, some are used to enter new data, some are used to perform calculations on the data but all that data is intertwined (data entered in view #1 is used to enter data in view #2 and then both are used to calculate

Open a Vuetify dialog from a component template in VueJS

我是研究僧i 提交于 2019-11-28 05:54:38
I'm using the VueJS Vuetify framework and I need to open a dialog - that gets imported as a component template - from another template. Once the Menu button in App.vue got clicked, the Modal should open. Here is my setup: App.vue = navigation template with Menu button Modal.vue = Modal template, imported as global in main.js main.js import Modal from './components/Modal.vue' Vue.component('modal', Modal) Modal.vue Template: <template> <v-layout row justify-center> <v-btn color="primary" dark @click.native.stop="dialog = true">Open Dialog</v-btn> <v-dialog v-model="dialog" max-width="290"> <v

Vuetify text field border missing

只谈情不闲聊 提交于 2019-11-28 04:09:53
问题 I'm trying to implement Veutify's text field This is what it looks like for me right now: And this is what it looks like when the text field is in focus: These are my imports in main.js import Vue from 'vue'; import Vuetify from 'vuetify'; Vue.use(Vuetify); Am I missing an import or something? 回答1: I ran in the same issue, you need to wrap your application in a <v-app> . The reason is that the border's color depends on the theme you're using. If you try to inspect the documentation you will

How can I add condition on vue component that is loaded from the view blade laravel?

早过忘川 提交于 2019-11-28 02:20:23
My view blade laravel like this : @extends('layouts.app') @section('content') ... <transaction></transaction> ... @endsection @section('modal') <transaction-modal/> @endsection The view blade laravel load two vue component. That are transaction component and transaction modal component. So if the view blade executed, it will run the components My transaction component like this : <template> ... <a href="#" data-toggle="modal" data-target="#modal-transaction" @click="show(item.id)">View</a> ... </template> <script> ... export default { ... methods: { show(id) { .... } } } </script> My

can't access data variables in watch handler vuejs

这一生的挚爱 提交于 2019-11-28 01:56:33
问题 I'm trying to set a data variable in a watch handler function for an input field in a VueJs Component. I have something like this: data() { return { params: { // default params to 1 month from: new Date().setMonth(new Date().getMonth() - 1), to: Date.now(), skip: 0, limit: 100 } } } watch: { dates: { handler: date => { console.log(this.params) if (date.start) { this.params.from = moment(date.start, "YYYY/MM/DD") } if (date.end) { this.params.to = moment(date.end, "YYYY/MM/DD") } }, deep: true

How to add vanilla .js to a custom Vue component

半城伤御伤魂 提交于 2019-11-28 00:35:23
问题 I'm trying to add a simple date-picker to a custom vue component. I'm not using webpack so I want to avoid ready made .vue components and I rather understand how to add simple javascript to vue. I'm following this official vue tutorial I've also seen this codepen but I can't manage to make the date picker appear. This is my jsfiddle: Html: <div class="app"> <datepicker id='date-elem'></datepicker> </div> app.js: Vue.component('date-picker', { extends: Flatpickr, mounted () { this.Flatpickr

Vue. How to get a value of a “key” attribute in created element

我们两清 提交于 2019-11-28 00:17:10
问题 I try to create a components and get its key for using in axios. Elements created, but I can't get a key. It's undefined <div class="container" id="root"> <paddock is="paddock-item" v-for="paddock in paddocks" :key="paddock.key" class="paddock"> </paddock> </div> <script> var pItem = { props: ['key'], template: '<div :test="key"></div>', created: function() { console.log(key); } }; new Vue({ el: '#root', components: { 'paddock-item': pItem }, data: { paddocks: [ {key: 1}, {key: 2}, {key: 3},

Event from parent to child component

放肆的年华 提交于 2019-11-27 22:39:24
问题 I have event that is generated in parent component and child has to react to it. I know that this is not recommended approach in vuejs2 and i have to do a $root emit which is pretty bad. So my code is this. <template> <search></search> <table class="table table-condensed table-hover table-striped" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="10"> <tbody id="trans-table"> <tr v-for="transaction in transactions" v-model="transactions"> <td v-for="item