// 子组件监听
watch: {
getSelect(obj) {
// console.log(obj)
this.$emit('select', obj)
},
// 监听数据变化
schedule(val){
this.parentSchedule = val;
},
// 将监听到的数据变化,传到父组件
parentSchedule(val) {
this.$emit('changeSchedule', val);
}
},
// 父组件
// 获取可预约日期时间
_getModelVisitorTime(){
api.getModelOrder({
model_id:this.$route.params.id,
}).then(res=>{
var obj = {}
var data = res.data
for(var i in data){
var dateArr = data[i].days.split(' ')[0]
var times = data[i].times.split('#')
obj[dateArr] = times;
}
// this.$set(this.schedule,obj)
this.schedule = obj
// console.log(this.schedule)
// console.log("getMOdelVisitor");
// console.log(this.$refs.timeSelect.getTimeList(obj))
})
},
//
changeSchedule(val){
this.schedule = val;
},
// 将字符串转换成datetime格式
_getDateTime(dateTimeStr){
var date = new Date(dateTimeStr).getDate()
var month = new Date(dateTimeStr).getMonth()+1
var Year = new Date(dateTimeStr).getFullYear()
var datetime = Year + '-' + month +'-' + date + ' ' + '00:00:00.000000'
return datetime
},
// 获取可预约日期时间
_getModelVisitorTime(){
var that = this;
api.getModelOrder({
model_id:this.$route.params.id,
}).then(res=>{
console.log(res)
var obj = {}
var data = res.data
for(var i in data){
var dateArr = data[i].days.split(' ')[0]
var times = data[i].times.split('#')
obj[dateArr] = times;
}
this.schedule = obj
console.log(this.schedule)
console.log("getMOdelVisitor");
console.log(this.$refs.timeSelect.getTimeList(obj))
})
},
为什么git每次git push 的时候要重复的输入用户名
[winUpdater]
recentlySeenVersion = 2.18.0.windows.1
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
email = [email protected]
name = kennana
//.gitconfig 添加一下配置
[credential]
helper = store
查询状态 git status
添加到本地仓库 git add . 添加所有文件,但是这样有点粗暴,我们修改了那个文件就可以 git add src/api/api.js
然后就是添加注释,你最近解决了什么问题 git commit -m"解决了问题的注释"
更新到码云,github上面去,git push
更新到本地,就可以是 git pull
最近在自学vue,照着网上例子写了一个父子组件的双向绑定,只实现了单向绑定。父组件的数据不能随子组件变化,只能是子组件数据随父组件变化;在官网看了文档一时还是无法理解其思路。
请各位前辈帮忙看看是哪里出的问题,谢谢
双向绑定
父:{{value}}
子:{{childvalue}}
vue双向绑定,首先来说要搞懂单向传递的原理,逐渐深入。父传子用props,子传父用$emit。
父传子还好说,在父级里把要传入的值,在子组件上动态绑定(v-bind)一个属性,把值传进去,然后子级用props来接受这个属性。
子传父的话有点复杂,首先来说子级在一个方法methods里,用this.$emit(‘属性名’,传的值)来传给父级,而父级需要用一个v-on来接收这个值。
下述为双向传递,我自己写了一篇笔记,分享给你,对你学习vue很有帮助,好好研读
baidu
配置环境前下好language-pack-en-base这个包,解决不同语言之间可能发生的冲突,-y参数的意思是直接安装无需确认
sudo apt-get update
sudo apt-get install -y language-pack-en-base
安装完成后运行locale-gen en_US.UTF-8
再在服务器上安装Git sudo apt-get install git
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:ondrej/php && sudo apt-get update
sudo apt-get -y install php7.2
# 如果之前有其他版本PHP,在这边禁用掉
sudo a2dismod php5
sudo a2enmod php7.2
# 安装常用扩展
sudo -y apt-get install php7.2-fpm php7.2-mysql php7.2-curl php7.2-json php7.2-mbstring php7.2-xml php7.2-intl
# 安装其他扩展(按需安装)
sudo apt-get install php7.2-gd
sudo apt-get install php7.2-soap
sudo apt-get install php7.2-gmp
sudo apt-get install php7.2-odbc
sudo apt-get install php7.2-pspell
sudo apt-get install php7.2-bcmath
sudo apt-get install php7.2-enchant
sudo apt-get install php7.2-imap
sudo apt-get install php7.2-ldap
sudo apt-get install php7.2-opcache
sudo apt-get install php7.2-readline
sudo apt-get install php7.2-sqlite3
sudo apt-get install php7.2-xmlrpc
sudo apt-get install php7.2-bz2
sudo apt-get install php7.2-interbase
sudo apt-get install php7.2-pgsql
sudo apt-get install php7.2-recode
sudo apt-get install php7.2-sybase
sudo apt-get install php7.2-xsl
sudo apt-get install php7.2-cgi
sudo apt-get install php7.2-dba
sudo apt-get install php7.2-phpdbg
sudo apt-get install php7.2-snmp
sudo apt-get install php7.2-tidy
sudo apt-get install php7.2-zip
成功后运行php -v查看版本,应显示类似信息
PHP 7.2.12-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Nov 12 2018 10:58:25) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.12-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
安装mysql
sudo apt-get install mysql-server mysql-client过程中输入密码,确定后安装完成。
mysql -u root -p再输入密码测试,能成功登陆即安装完成。exit退出mysql
因为上线的应用为laravel 5.5版本开发的,为了之后的兼容性问题,ubuntu14.04直接安装的mysql不是较新版本,因此要升级一下mysql:
cd ~
wget https://dev.mysql.com/get/mysql-apt-config_0.8.1-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.1-1_all.deb
解压安装包后会弹出框,选择好mysql 5.7版本后选择ok 然后继续
然后,更新包索引:sudo apt-get update
然后,安装MySQL-server:sudo apt-get install mysql-server
然后,升级全部的Mysql数据库:sudo mysql_upgrade -u root -p
最后,重启mysql server:sudo service mysql restart
登陆一下mysql看看是否已经升级完毕,成功了进入下一步
mysql -uroot -p密码
由于apache2指向的网站根目录是/var/www/html/,要修改配置文件000-default.conf
vim /etc/apache2/sites-enabled/000-default.conf
使网站根目录指向 /var/www/html/public/
然后再修改/etc/apache2/apache2.conf的这里
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
将AllowOverride None 的None改为All.保存重启apache2
这时访问网址,如果出现500错误.那就是由于storage目录没有 777 权限。
到/var/www/html/目录 执行
chmod -R 777 storage
在Unbuntu中重启Apache服务器出现错误:AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1.等等。解决方法:
$ sudo vim /etc/apache2/apache2.conf
最后加入一句: ServerName localhost:80
sudo apache2ctl -k restart