php - Vue.js 脚本在我的 heroku Laravel 应用程序中不起作用
问题描述
我正在尝试在 heroku 上部署一个 laravel 应用程序。除了所有的 vue.js 脚本,一切都很顺利。我已经有了 node js buildpack 并尝试在 heroku 上运行 npm run prod。我的 laravel 应用程序在我的本地运行良好。这是我从控制台得到的错误:https ://imgur.com/a/uqFC97y
这是我的网站:http ://dqrs.herokuapp.com/queues/create
如何复制错误:
- 选择任何一个部门。预期结果:包含选项的下拉列表应出现在交易标签下方。
我将触发交易下拉菜单的按钮代码:
<div class=" btn-group-toggle col-sm-12 col-md-4 text-center mt-2">
<label @click="setDropdown('{{$department->name}}')" class="btn btn-default btn-lg w-100 text-uppercase" onclick="getdept({{$department}})">
<input type="radio" name="department" value="{{ $department->name}}" sr-only required> {{ $department->name}}
</label>
</div>
我的交易下拉代码:
<div class="col-sm-12 col-md-4 form-group{{ $errors->has('transaction') ? ' has-danger' : '' }}">
<label class="form-control-label" for="input-transaction">{{ __('Transaction') }}</label>
<select class="form-control form-control-md" v-if="dropdown.length" v-model="selected" name="transaction" required>
<option v-for="item in dropdown" :value="item">@{{ item }}</option>
<option>Other</option>
</select>
@if ($errors->has('transaction'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('transaction') }}</strong>
</span>
@endif
</div>
我的 vue.js 脚本:
<script>
const app = new Vue({
el:'main',
data:{
dropdown: [],
selected: null,
trans:{
}
},
mounted(){
this.getTrans();
$('#confirmModal').modal({
backdrop: 'static',
keyboard: false
});
},
methods:{
getTrans(){
axios.get('create/transactions')
.then((response)=>{
this.trans=response.data
})
.catch(function (error){
console.log(error);
});
},
setDropdown: function (type) {
this.selected = null;
this.dropdown = this.trans[type];
console.log(type)
},
isPrio(value) {
document.getElementById('prio').value = value;
$('#confirmModal').modal('hide');
}
}
})
</script>
解决方案
推荐阅读
- jupyter-notebook - 如何在 Jupyter Notebook 中获取输出历史记录?
- r - 当在 R Shiny 中使用带有可选用户输入的 Reactive 函数时,为什么在没有用户输入时反应基础对象会减少?
- html - 如何在下拉菜单顶部移动 3 个热门国家
- javascript - 无法在 Heroku 上的 Rails 应用程序中构建 Ember.js 应用程序
- centos - 谁能知道“vggbase-lv_opt”是什么?
- icalendar - 未使用 ICS 文件向提及的组织者邮件显示通知
- c - C 中的 system() 无限次打印传递的命令而不是执行它 - 错误
- ios - 可访问性检查器不适用于 iOS 12.0
- node.js - 如何在单个 CPU 上创建多个工作线程
- unicode - CertGetNameString 引发堆损坏