vue-component

Can we make vue.js application without .vue extension component and webpack?

痴心易碎 提交于 2019-11-27 01:09:05
问题 Note: Can we write vue.js large application without using any compiler for code like currently i see all example use webpack now to make vue.js code compatible for browser . I want make vue.js application without webpack and without using .vue extension. Is it possible? if it is possible, can you provide a link or give sample how to use routing in that case. As we make component in .vue extension can be make component in .js extension and use application as we do in angular 1 where we can

Open a Vuetify dialog from a component template in VueJS

混江龙づ霸主 提交于 2019-11-27 01:05:14
问题 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

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

不羁岁月 提交于 2019-11-26 23:39:44
问题 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> ..

Global data with VueJs 2

妖精的绣舞 提交于 2019-11-26 22:31:38
Im relatively new with VueJS, and I've got no clue about how to make some data globally available. I would like to save data like API endpoints, user data and some other data that is retrieved from the API somewhere where each component can get to this data. I know I can just save this with just vanilla Javascript but I suppose there is a way to do this with VueJS. I may be able to use the event bus system to get the data but I don't know how I can implement this system to my needs. I would appreciate it if somebody can help me with this. Make a global data object const shared = { api: "http:/

Using custom theming in Vuetify and pass color variables to components

别等时光非礼了梦想. 提交于 2019-11-26 19:42:54
问题 In my index.js file I have manually override the Vuetify theme object with my company's color: Vue.use(Vuetify, { theme: { primary: '#377ef9', secondary: '#1b3e70', accent: '#ff643d', error: '#ff643d' ... } Now, I can use these colors from my templates like so: <my-text-field name="input text" label="text" value="text text text text..." type="text" color="primary"> </my-text-field> What I'm after is using the primary or any other variable in the theme object defined above, inside my template

How to display content by page number or prev next clicked on the vue?

梦想的初衷 提交于 2019-11-26 18:39:46
问题 My vue component like this : <template> ... <b-col v-for="item in items" v-bind:key="item.id" cols="2"> ... <strong slot="header" class="text-dark" :title="item.tittle" >{{item.tittle}}</strong><br/> ... <strong class="bg-warning text-dark"><i class="fa fa-money"></i> <b>{{item.price}}</b></strong><br/> ... </b-col> ... <b-pagination size="sm" :total-rows="itemsPagination.total" :per-page="itemsPagination.per_page" v-model="itemsPagination.current_page" prev-text="Prev" next-text="Next" hide

How to add external JS scripts to VueJS Components

穿精又带淫゛_ 提交于 2019-11-26 16:01:32
I've to use two external scripts for the payment gateways. Right now both are put in the 'index.html' file. However, I don't want to load these files at the beginning itself. The payment gateway is needed only in when user open a specific component (using router-view). Is there anyway to achieve this? A simple and effective way to solve this, it's by adding your external script into the vue mounted() of your component. I will illustrate you with the Google Recaptcha script: <template> .... your HTML </template> <script> export default { data: () => ({ ......data of your component }), mounted()

[Vue warn]: Property or method is not defined on the instance but referenced during render

北城以北 提交于 2019-11-26 15:18:14
问题 var MainTable = Vue.extend({ template: "<ul>" + "<li v-for='(set,index) in settings'>" + "{{index}}) " + "{{set.title}}" + "<button @click='changeSetting(index)'> Info </button>" + "</li>" + "</ul>", data: function() { return data; } }); Vue.component("main-table", MainTable); data.settingsSelected = {}; var app = new Vue({ el: "#settings", data: data, methods: { changeSetting: function(index) { data.settingsSelected = data.settings[index]; } } }); With the above code, the error below occurs

Best approach when replacing jQuery with VueJS 2 in multi-page existing .NET MVC application

喜欢而已 提交于 2019-11-26 15:14:24
问题 I am very new in VueJS I have multi-page ASP.NET MVC app where I want to use VueJS (components, 2-way binding, validation, CRUD operations) Currently using jQuery for DOM manipulation, Ajax requests etc How should I approach this? I am getting way too much variations in thoughts from different posts (online) Could anyone please guide me and give me some pointers to get started? Some step by step doc will be great that shows how to do this with a hello world page (MVC View) with vuejs single

How to make dynamic routes on the vue router?

大城市里の小女人 提交于 2019-11-26 11:41:45
问题 My MainNavBar component like this : <template> ... <v-list-item v-for=\"(item, index) in listMenu\" :key=\"index\" @click=\"goTo(item)\" > <v-list-item-content> <v-list-item-title>{{ item }}</v-list-item-title> </v-list-item-content> </v-list-item> ... </template> <script> export default { ... methods: { goTo(key) { this.$router.push({ name: key }); }, ...mapActions(\"dataStore\", [\"getMenu\"]) }, computed: { ...mapGetters(\"dataStore\", [\"listMenu\"]) } }; </script> listMenu taken from API