vue-component

Global Vue Component Exposure via Webpack

Deadly 提交于 2019-12-24 19:16:06
问题 So basically, I'm trying to make a hybrid structure for an MVC project. The frontend framework will be managed by Webpack and VueJS. However, after weeks of tinkering and picking up proper Webpack knowledge together with Vue, i've been unable to achieve what I want to do so. So right above is the project structure, but specifically the webpack layer. The webpack folder will first be packed by Webpack into the wwwroot/dist folder, which would end up like this; From here, we'll be able to

Vue.JS radio input without v-model

坚强是说给别人听的谎言 提交于 2019-12-24 17:01:26
问题 I have a component that takes an array of options objects, a name, and a v-model, and puts out a radio input with matching label for each of the options in that array of options. options = [ {text: "Option 1", value="option-1" }, {text: "Option 2", value="option-2" }, ] "updateValue" : function(){ this.$emit('input', this.$refs.input.value); } <template v-for="option in options" > <input :value="option.value" :id="name + option.value" :name="name" @input="updateValue()" ref="input" /> <label

How to build a simple Vue.js application using a separate template file?

China☆狼群 提交于 2019-12-24 16:35:12
问题 I'm new to Vue.js and I'm confused about file structure and how to build a simple application. I have installed Vue CLI on my mac using this command: npm install -g @vue/cli Then I created a counter project and used the default option: vue create counter Then I started the application: cd counter npm run serve The default application code seemed confusing to me so I want to create my own simple application that makes more sense to me: I created counter.html inside the public folder: <html

How can I able to upload picture using vue js?

孤者浪人 提交于 2019-12-24 15:06:58
问题 I need to upload the image using vue js. My html code to insert picture is <input type="file" id="wizard-picture"> My vue js code is as.. <script> submitBox = new Vue({ el: "#submitBox", data: { username: '', picture: '', }, methods: { handelSubmit: function(e) { var vm = this; data = {}; data['username'] = this.username; data['picture'] = this.picture; $.ajax({ url: 'http://127.0.0.1:8000/api/add/post/', data: data, type: "POST", dataType: 'json', success: function(e) { if (e.status) { alert

Injecting property defaults into 3rd party Vue component

折月煮酒 提交于 2019-12-24 09:16:00
问题 I am using a datepicker component in my project. Basic usage would be like this: date-picker(language="fr" v-model="date") There are several attributes which will get repeated each time we need to use a date picker: language for instance. So I would like to be able to simply do that when a date picker is needed. date-picker(v-model="date") And that would default to fr for the language property of the 3rd party library. Here is what I have tried: A custom component which extends the Datepicket

Why v-model not working in input datetimepicker bootstrap? (Vue.JS 2)

[亡魂溺海] 提交于 2019-12-24 08:47:30
问题 My vue component, you can see this below : <template> <div> <div class="col-sm-2"> <div class="form-group"> <input v-model="fromDate" data-date-format="DD-MM-YYYY" title="DD-MM-YYYY" type="text" class="form-control" placeholder="Date" name="to_date" id="datetimepicker" required> </div> </div> <div class="col-sm-1"> <div class="form-group" style="text-align: center"> - </div> </div> <div class="col-sm-2"> <div class="form-group"> <input v-model="toDate" data-date-format="DD-MM-YYYY" title="DD

How to trigger a function using @click inside infowindow of google maps in vue js?

眉间皱痕 提交于 2019-12-24 08:19:17
问题 My current code is addpolygon: function(e) { var vm = this; var point = { lat: parseFloat(e.latLng.lat()), lng: parseFloat(e.latLng.lng()) }; vm.coord.push(point); vm.replot(); vm.marker = new google.maps.Marker({ position: point, map: vm.map, icon: "/fred.png" }); vm.infowindow = new google.maps.InfoWindow({ content:"<a class=\"btn btn-danger\" @click.native=\"removePoint("+vm.markerid+)\">Remove</a>", maxWidth: 300 }); vm.bindInfoWindow(vm.marker, vm.map, vm.infowindow); vm.markers[vm

Include component from parent app in component contained in node_modules directory

自闭症网瘾萝莉.ら 提交于 2019-12-24 08:02:06
问题 I am working on Vue app that incorporates Vue Bootstrap Calendar, and I would like to be able to override the content of the day cell (handled by the Day.vue component) to add my own custom content inside. My thought was initially to modify the Day component to include <slot></slot> tags and pass in the custom content that way. The problem has to do with accessing the Day component. To include the calendar in your app, you include the Calendar.vue component, which includes Week.vue , which in

How to bind Checkboxes with Chips in Vue js(Two way Binding)

*爱你&永不变心* 提交于 2019-12-24 07:37:29
问题 Im a newbie in Vue Js. The problem is on selecting an dropdown from form,options are coming in form of checkbox in a div,on selecting of checkbox, chips should display with the checkbox label.But here checkbox is automatically getting selected and chips are getting displayed,But after selecting an checkbox chips should display and on closing the chips checkbox should get Deselect.This is expected but not happening.Here is the my code.Kindly help. <template> <div id="app"> <v-layout row wrap>

Vue.js - access data property from within template without using props in vue file

安稳与你 提交于 2019-12-24 06:17:10
问题 In my Laravel + Vue.js SPA (Single Page Application), I am using BootstrapVue and VeeValidate. In EditProfile.vue file, I want to access the data property namely default_country_code from an attribute in the template namely default_country_code . I can achieve it by using props i.e: having a data attribute in Vue root instance and then using it in the template with the help of props in EditProfile.vue file. But I want to use it in the template without using any props . Because if I use props