我正在尝试在表单中实现复选框和laravel集合,但是我在表单中仅获得单个值,以及如何解决它的任何想法
{!! Form::open(array('action'=>'UserController@updateInfo','method'=>'post')) !!}
Workdays:
<br>
{!! Form::label('monday', 'Monday') !!}
{!! Form::checkbox('workday', 'monday') !!}
<br>
{!! Form::label('tuesday', 'Tuesday') !!}
{!! Form::checkbox('workday', 'tuesday') !!}
<br>
{!! Form::label('wednesday', 'Wednesday') !!}
{!! Form::checkbox('workday', 'wednesday') !!}
<br>
{!! Form::label('thursday', 'Thursday') !!}
{!! Form::checkbox('workday', 'thursday') !!}
<br>
{!! Form::label('friday', 'Friday') !!}
{!! Form::checkbox('workday', 'friday') !!}
<br>
{!! Form::label('saturday', 'Saturday') !!}
{!! Form::checkbox('workday', 'saturday') !!}
<br>
{!! Form::label('sunday', 'Sunday') !!}
{!! Form::checkbox('workday', 'sunday') !!}
<br>
{!! Form::submit('Save', $attributes = ['class'=>'button']) !!}
{!! Form::close() !!}
Run Code Online (Sandbox Code Playgroud)
当我打印请求时,我只会得到单个输出(例如,选定的星期一星期五,在处理请求时我只会得到星期五)
标签也不起作用-关于这个的想法吗?
有没有办法在一行中执行以下操作?
--widthA: get-vw(20px);
font-size: calc(5px + var(--widthA));
Run Code Online (Sandbox Code Playgroud)
因为我需要设置一个最小值font-size
。该get-vw
函数将在 vw 中计算 20px,我需要在此之上添加 5px。
我正在尝试做一些类似自动保存的事情,但只有当用户没有在 textarea 中输入任何东西时才需要调用函数,例如 5 秒
<textarea @keyup="test" class="protocol-paragraph" name="" id="" rows="10">{{ somedata }}</textarea>
methods: {
test(){
console.log('saving...');
}
}
Run Code Online (Sandbox Code Playgroud)
我需要设置带有时间戳的自定义计数器还是有一个简单的解决方案?如果我只是设置超时,它会在每次击键 5 秒后调用
在这个例子中,我使用axios为我获取一些数据,然后我需要传递这些值并将其存储在Vuex中
带有axios请求的vue文件:
<script>
export default {
data: function () {
return {
userData: {},
login: {
username: '',
password: '',
},
}
},
computed: {
loggedInUser() {
return this.$store.state.loggedInUser;
}
},
methods: {
handleLoginFormSubmit() {
// send axios request to controller and from controller to gRPC
axios.post('/loginUser', this.login)
.then((response) => {
this.userData = JSON.parse(response.data[0]);
})
// set loggedInUser info to vuex store
this.$store.dispatch('loginUser',this.userData);
}
},
}
</script>
Run Code Online (Sandbox Code Playgroud)
当我检查userData对象是否存在我现在需要的所有信息时,我有store.js文件应该传递该userData并将其保存在Store但我总是得到空对象里面
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
export const store …
Run Code Online (Sandbox Code Playgroud) 如果我有一个矩阵
[3,1,2,4]
[A B C D]
我需要用usort键排序第一行.但是,当我想重新排序第一个数组时,列如何移动
因此在这种情况下输出将如此描述顶部
[1,2,3,4]
并[b,C,A,d]
我找到了一个关于如何编写将像素转换为 vw 的函数的教程:
@function get-vw($target) {
$vw-context: (1000*.01) * 1px;
@return ($target/$vw-context) * 1vw;
}
Run Code Online (Sandbox Code Playgroud)
教程中的用法:
.headline {
font-size: get-vw(72px);
}
Run Code Online (Sandbox Code Playgroud)
但是当我像它所解释的那样使用它时,我的浏览器没有返回任何结果:
字体大小:get-vw(44px);属性值无效
因为我现在不需要学习 sass,但只需要将 px 转换为 vw 的方法,有人可以帮助我完成这项工作吗?
谁能解释一下这段代码?我无法理解为什么此代码中的打印值为8
有人可以向我解释
#include <stdio.h>
int f(int i){
switch (i){
case 0 :
return 0;
case 1:
case 2:
return 1;
default:
return f(i-2)+f(i-1);
}
}
void main(void) {
printf("%d", f(6));
}
Run Code Online (Sandbox Code Playgroud)