我正在尝试在Laravel中使用vue和vuetify。没有Vuetify,我已经有一个Vue组件可以正常工作。当我安装vuetify v1.5.1
并尝试使用包括v-app的v-btn时,它在控制台中给了我这个错误。
我使用这些版本
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue": "^2.6.6",
"vue-template-compiler": "^2.6.6"
app.js
require('./bootstrap');
import 'vuetify/dist/vuetify.min.css'
window.Vue = require('vue');
import Vuetify from 'vuetify'
Vue.component('example-component',
require('./components/ExampleComponent.vue').default);
Vue.component('daily-delivery-planner',
require('./components/DailyDeliveryPlanner.vue').default);
Vue.use(Vuetify);
const app = new Vue({
el: '#app'
});`
DailyDeliveryPlanner.vue
`<template>
<div class="page-content browse container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel panel-bordered">
<div class="panel-body">
<div class="col-md-9">
<div class="form-group row">
<label for="day" class="col-sm-1 col-form-label custom-label">Select A Day</label>
<div class="col-sm-9">
<v-btn color="success">Success</v-btn>
</div>
</div>
</div>
<div class="col-md-3">
<div class="">
<h4>Route Plan Code : <span class="label label-info" id="routeplanno">{{ routeplan_no }}</span></h4>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
routeplan_no: "",
};
},
methods: {
getUserData: function() {
axios.get('retreiveUserData')
.then(({data}) => {
if(data.alert=='success'){
this.routeplan_no = data.data;
}else{
this.routeplan_no = Math.floor(1000 + Math.random() * 9000);
}
});
}
},
beforeMount() {
this.getUserData();
}
}
</script>`
功能和所有功能正常工作,但唯一的问题是我无法使用vuetify组件。
browse.blade.php
@extends('voyager::master')
@section('content')
<v-app id="app">
<daily-delivery-planner></daily-delivery-planner>
</v-app>
@endsection`
为什么会发生?任何帮助,将不胜感激!
答案 0 :(得分:0)
Omega
的ID为lmer
,其ID由N=20 #number of subject
n=5 #number of observations per subject
sigma2 =1
#equally space point not include the start point
time <- function(from, to, length.out) {
length.out <- length.out + 1
result <- seq(from, to, length.out = length.out)
result <- result[-1]
return(result)
}
subject = matrix(0,nrow=N*n,ncol=1)
for(i in 1:N){
for(j in (n*(i-1)+1):(n*i)){
subject[j]=i
}
}
X = array(0, dim = c(N, n, 3))#each X[i,,] is a nx3 matrix
for (i in 1:N){
for (j in 1:n){
X[i,j,] <-c(1,time(0,10,n)[j],(time(0,10,n)[j])^2)
}
}
y = array(0, dim = c(N, n, 1))
Omega <- matrix(0,nrow=3,ncol=3)
Omega[1,1] = runif(1,0.01,1.01)#only omega1^2 is not equal to 0
beta <-rep(0,5)
beta[1]= rnorm(1,mean=0.01,sd=1) #mu0
beta[2]= rnorm(1,mean=0.005,sd=1) #mu1
beta[3]= rnorm(1,mean=0.0025,sd=1) #mu2
C1 = array(0, dim = c(N, 3, 5))
for(i in 1:N){
C1[i,1,1]=C1[i,2,2]=C1[i,3,3]=1
}
muy = array(0, dim = c(N, n, 1)) #store the expextation of each yi
Cov = array(0, dim = c(N, n, n)) #store the covariance matrix of y
for (i in 1:N){
muy[i,,] <- X[i,,]%*%C1[i,,]%*%beta
Cov[i,,] <- X[i,,]%*%Omega%*%t(X[i,,])+ sigma2*diag(n)
y[i,,] <- mvrnorm(n = 1, muy[i,,], Cov[i,,])
}
ym <- as.vector(y[,,1])
#change X into X2, which is in a matrix format, easy for compitation later
X2 <- rbind(X[1,,],X[2,,])
for(i in 2:(N-1)){
X2 = rbind(X2,X[i+1,,])
}
XC1=matrix(0,nrow=N*n,ncol=5)
for(i in 1:N){
XC1[(n*(i-1)+1):(i*n),]=X[i,,]%*%C1[i,,]
}
M1<-lmer(ym ~ 0+XC1+(0+X2|subject))
初始化,然后您也将其初始化为组件,因此Vue对其进行了两次初始化。另外,错误还表明您的Vue版本太低。