vue-component

How to pass pass pramas in b-nav-item using store getters?

雨燕双飞 提交于 2019-12-11 14:16:13
问题 My route is like this - { path: '/user/:uid/myorders', name: 'my-orders', component: () => import(/* webpackChunkName: "user-orders" */ './admin/UserOrdersPage.vue'), meta: { requiresLogin: true }, beforeEnter: (to, from, next) => { checkForAuth(to, next); } }, I need to pass uid value from store.getters in b-nav-item element to navigate the page using uid from store. This is what I am doing right now. <b-nav-item href="#" v-if="this.$store.getters.isUser" tag="router-link" :to= "{name: 'my

How can I update value in input type text on vue.js 2?

我的未来我决定 提交于 2019-12-11 13:46:32
问题 My view blade laravel like this : <form slot="search" class="navbar-search" action="{{url('search')}}"> <search-header-view></search-header-view> </form> The view blade laravel call vue component (search-header-view component) My vue component(search-header-view component) like this : <template> <div class="form-group"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search" name="q" autofocus v-model="keyword" :value="keyword"> <span class="input-group-btn">

How to use external vue npm components

天涯浪子 提交于 2019-12-11 13:30:21
问题 I am new to Vue.js, and am currently trying to use it in an existing solution. It is not possible for me to use .vue files. It's a standalone system, not using webpack. I need the files locally to make it work. In the example below, I have used .js's online. I want to use this datepicker: https://github.com/mengxiong10/vue2-datepicker My problem is that the datepicker isn't rendered. I don't know how to register the component. I have tried to isolate what I want to do in a simple standalone

VueJs Send data to modal component

夙愿已清 提交于 2019-12-11 13:26:21
问题 i want to send my data (first component) to modal (another component). Both component are located in this same place. I need show data to first component data form to my edit modal. Here is my code: form.vue : <template> <tbody v-for="user,index in users"> <button type="button" class="btn btn-xs" data-toggle="modal" data-target="#editModal"> -> edit button, show modal (...) <edit-user></edit-user> (...) </template> <script> components: { add: addUser, edit: editUser }, </script> edit.vue:

How can I add button click for call a method if I click icon next month in the datepicker on vuetify?

天涯浪子 提交于 2019-12-11 10:55:23
问题 I want to ask. How can I add button click for call a method if I click icon next month in the datepicker? Look at this : How can I do it? Update : I using vuetify : https://vuetifyjs.com/en/components/date-pickers#date-pickers-allowed-dates 回答1: Probably you're looking for something like this: https://vuetifyjs.com/en/components/date-pickers#date-pickers-react-to-displayed-month-year-change Basically you should use the picker-date.sync prop and watch for its changes using a watcher. <v-date

How can I get month moment js in loop on the vue?

非 Y 不嫁゛ 提交于 2019-12-11 10:54:31
问题 I have a problem Look at this : https://codepen.io/positivethinking639/pen/YzzWyaR?editors=1010 If the script executed, the result of console.log(date) is Whereas from my script should the result 2019-10-01 2019-10-02 ... ... 2019-10-31 why the results don't match? if I choose next month, the results will also not match 回答1: Updated for loop initialisation for(var i = 1; i <= totalDay; i++) { and let date = moment().month(val.split('-')[1]-1).date(i).format("YYYY-MM-DD") Now it works as

How to add eventlistener in vue and have access to components in this.$refs

筅森魡賤 提交于 2019-12-11 10:50:02
问题 The structure of my root component is something like this <Header /> <router-view> <somecomponent> <component A ref="componentA" /> <component B ref="componentB" /> </somecomponent> </router-view> <Footer /> I am using an event bus to communicate between components in the header and components in the router-view as per adding component to parent from child in vue When receiving an event in the somecomponent in router-view, I would like to do something to componentA through this.$refs

How do you access exported vm (main vue instance) object from a component?

こ雲淡風輕ζ 提交于 2019-12-11 10:48:28
问题 If I start my vue instance from a main.js file //main.js var vm = new Vue({ el: '#app', render: h => h(App), router, data: { } }); export { vm } app.vue itself is a router view. <template> <router-view></router-view> </template> <script> export default {} </script> So lets say one of the components that gets loaded in the router needs access to vm? I've gotten as far as to do this in the component: import vm from '../main.js' It seems to find the main.js file. But how do I then access vm? An

How can I get value in datetimepicker bootstrap on vue component?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 08:48:33
问题 My view blade, you can see this below : ... <div class="panel-body"> <order-view v-cloak> <input slot="from-date" data-date-format="DD-MM-YYYY" title="DD-MM-YYYY" type="text" class="form-control" placeholder="Date" name="from_date" id="datetimepicker" required> <input slot="to-date" data-date-format="DD-MM-YYYY" title="DD-MM-YYYY" type="text" class="form-control" placeholder="Date" name="to_date" id="datetimepicker" required> </order-view> </div> ... My order-view component, you can see this

How to add preloader and success message on form submit using vue-resource

旧街凉风 提交于 2019-12-11 08:45:56
问题 How to accomplish below task using vue-resource: Include preloader text Loading... or gif image when fetching the data from the server. Show success message on form submit. 回答1: One way of doing this is : <template> <div> <div class="loader" v-if="loader"></div> <div> //display fetchedData using logic you wish like v-for..... </div> <form> //your form inputs <button @click.prevent="submit">Submit</button> </form> </div> </template> <script> export default{ data(){ return{ loader: false,