vuetify eingebunden + erster Versuch Combobox
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const CreateMsgRouter = {
|
||||
template: `
|
||||
template: `
|
||||
<div class="card om-card">
|
||||
<h4>Neue Nachricht erstellen</h4>
|
||||
<form class="new-msg-form" @submit.prevent=createMsg>
|
||||
@@ -15,6 +15,18 @@ const CreateMsgRouter = {
|
||||
<label class="bmd-label-floating">Tags</label>
|
||||
<input type="text" class="form-control" id="tag">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<v-combobox
|
||||
v-model="select"
|
||||
:items="items"
|
||||
label="I use chips"
|
||||
multiple
|
||||
chips
|
||||
></v-combobox>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="bmd-label-floating">Nachricht*</label>
|
||||
<textarea class="form-control" id="message" rows="5"></textarea>
|
||||
@@ -22,30 +34,51 @@ const CreateMsgRouter = {
|
||||
<button class="btn btn-default"><a @click="$router.go(-1)">ABBRECHEN </a></button>
|
||||
<button type="submit" class="btn btn-raised om-btn"><a @click="$router.push('/home')">SENDEN</a></button>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
`,
|
||||
data: function () {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
createMsg: function() {
|
||||
var subject=$("#subject").val();
|
||||
var message=$("#message").val();
|
||||
var tag=$("#tag").val();
|
||||
var user=$("#user").val();
|
||||
console.log ("Message Created: "+tag+" "+message+" "+user);
|
||||
$.ajax ({ url: "api/createMsg", data: {sub: subject, mess: message, use: user, ta: tag}, method: "POST" }) .done (have_result) .fail (have_error);
|
||||
function have_result (res) {
|
||||
console.log (res);
|
||||
data: function () {
|
||||
return {
|
||||
select: ['Design', 'jj'],
|
||||
items: [
|
||||
'Programming',
|
||||
'Design',
|
||||
'Vue',
|
||||
'Vuetify'
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
createMsg: function () {
|
||||
var subject = $("#subject").val();
|
||||
var message = $("#message").val();
|
||||
var tag = $("#tag").val();
|
||||
var user = $("#user").val();
|
||||
console.log("Message Created: " + tag + " " + message + " " + user);
|
||||
$.ajax({
|
||||
url: "api/createMsg",
|
||||
data: {
|
||||
sub: subject,
|
||||
mess: message,
|
||||
use: user,
|
||||
ta: tag
|
||||
},
|
||||
method: "POST"
|
||||
}).done(have_result).fail(have_error);
|
||||
|
||||
function have_result(res) {
|
||||
console.log(res);
|
||||
}
|
||||
function have_error (err) {
|
||||
console.log ("error: " + err.responseText);
|
||||
console.log (err);
|
||||
|
||||
function have_error(err) {
|
||||
console.log("error: " + err.responseText);
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted: function() {
|
||||
if ($(this).bootstrapMaterialDesign)
|
||||
$(this).bootstrapMaterialDesign();
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
if ($(this).bootstrapMaterialDesign)
|
||||
$(this).bootstrapMaterialDesign();
|
||||
},
|
||||
};
|
||||
|
||||
@@ -11,6 +11,7 @@ const ProfilRouter = {
|
||||
</div>
|
||||
<div v-else-if="!isAuthentified">
|
||||
<button v-on:click="showLoginModal=true" @clicked="logIn">Login</button>
|
||||
<v-rating v-model="rating"></v-rating>
|
||||
<login-panel v-if="showLoginModal" @clicked="closeModal" ></login-panel>
|
||||
</div>
|
||||
</div>`,
|
||||
@@ -19,6 +20,7 @@ const ProfilRouter = {
|
||||
profilcard: _profilcard,
|
||||
showLoginModal: false,
|
||||
isAuthentified: false,
|
||||
rating: 3,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -28,12 +30,10 @@ const ProfilRouter = {
|
||||
},
|
||||
|
||||
logIn (value) {
|
||||
|
||||
this.showLoginModal=false;
|
||||
},
|
||||
|
||||
logOut () {
|
||||
|
||||
this.isAuthentified=false;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
import Vuetify from 'vuetify'
|
||||
|
||||
Vue.use(Vuetify)
|
||||
Reference in New Issue
Block a user