我有我的PHP代码,我确实有一些变量
$checked = true;
Run Code Online (Sandbox Code Playgroud)
而我正在写这样的东西
<input v-model="subscribed" type="checkbox" <?= ($checked ? 'checked' : '') ?> />
Run Code Online (Sandbox Code Playgroud)
现在在我的vue js文件中,如何使用此检查数据填充我的模型
subscribed 具有真或假的价值.(我不打算通过PHP代码直接为js赋值,我需要在其中设置它/在输入中自己不在其他地方)
请检查代码段.
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/vue@2.1.10/dist/vue.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div id="app">
<label>
<input id='sub' v-model="subscribed" @click="printState" type="checkbox" checked />
Subscription
</label>
</div>
<script>
new Vue({
el: '#app',
data: function() {
return {
subscribed: false,
// subscribed: sub.checked
// ^ this works but i dont want to add everytime id and get its …Run Code Online (Sandbox Code Playgroud)我就是想知道前端octobercms怎么上传多个文件没有教程,
我在用
<input name="posting-image" type="file" multiple="multiple" />
Run Code Online (Sandbox Code Playgroud)
然后只得到最后上传的图像
$posting->posting->image=Input::file('posting-image');
$posting->save();
Run Code Online (Sandbox Code Playgroud)
如何检索所有图像?