Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
青春狗头少年不会梦到格温学姐
【前端】vue井字棋游戏
提交
a1a86cf3
【
【前端】vue井字棋游戏
项目概览
青春狗头少年不会梦到格温学姐
/
【前端】vue井字棋游戏
与 Fork 源项目一致
Fork自
inscode / VueJS
通知
1
Star
4
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
【
【前端】vue井字棋游戏
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a1a86cf3
编写于
5月 31, 2023
作者:
6
641737939035885f1803c7ba
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Auto Commit
上级
34ff110b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
7 addition
and
2 deletion
+7
-2
src/App.vue
src/App.vue
+7
-2
未找到文件。
src/App.vue
浏览文件 @
a1a86cf3
...
@@ -22,7 +22,9 @@ export default {
...
@@ -22,7 +22,9 @@ export default {
//放置棋子
//放置棋子
set
(
idx
)
{
set
(
idx
)
{
if
(
!
this
.
datas
[
idx
]
&&
!
this
.
winner
)
{
if
(
!
this
.
datas
[
idx
]
&&
!
this
.
winner
)
{
this
.
datas
[
idx
]
=
this
.
next_player
this
.
datas
[
idx
]
=
this
.
next_player
console
.
log
(
this
.
datas
[
idx
],
'
idx
'
)
this
.
history
.
push
({
this
.
history
.
push
({
status
:
[...
this
.
datas
],
status
:
[...
this
.
datas
],
player
:
this
.
next
player
:
this
.
next
...
@@ -70,7 +72,10 @@ export default {
...
@@ -70,7 +72,10 @@ export default {
<
template
>
<
template
>
<div
id=
"main"
>
<div
id=
"main"
>
<ul
id=
"board"
class=
"white normal"
>
<ul
id=
"board"
class=
"white normal"
>
<li
class=
"square"
v-for=
"i, idx in datas"
@
click=
set(idx)
>
{{
i
}}
</li>
<li
class=
"square"
v-for=
"i, idx in datas"
@
click=
"set(idx)"
:style=
"i==='O'?'color:#5fbacf':'color:red'"
>
{{
i
}}
</li>
</ul>
</ul>
<div
id=
"console"
>
<div
id=
"console"
>
<div
id=
"hint"
class=
"white"
>
{{
hint
}}
</div>
<div
id=
"hint"
class=
"white"
>
{{
hint
}}
</div>
...
@@ -144,7 +149,7 @@ export default {
...
@@ -144,7 +149,7 @@ export default {
.square
{
.square
{
height
:
100px
;
height
:
100px
;
width
:
100px
;
width
:
100px
;
border
:
#e
bebeb
solid
1px
;
border
:
#e
9ecec
solid
1px
;
flex
:
0
0
auto
;
flex
:
0
0
auto
;
font-size
:
50px
;
font-size
:
50px
;
font-weight
:
900
;
font-weight
:
900
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录