-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
263ea88
commit ab402ff
Showing
20 changed files
with
712 additions
and
185 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<template> | ||
<div> | ||
<div class="effect-display-wrap"> | ||
<div | ||
:style="{ | ||
writingMode: writingModeVal | ||
}" | ||
>文字排布{{writingModeVal === "horizontal-tb"? "水平":"垂直"}}方向</div> | ||
</div> | ||
<div class="language-css extra-class"> | ||
<pre class="language-css" style="margin-bottom:30px;"><code ref="css"></code></pre> | ||
</div> | ||
<div class="attr-operate-wrap"> | ||
<div class="attr-inner-content"> | ||
<div class="text-width">决定文本在水平或垂直方向上如何排布-writing-mode:</div> | ||
<el-radio-group v-model="writingModeVal" class="el-radio-group"> | ||
<el-radio class="radio" v-for="item in writingModes" :key="item" :label="item">{{ item }}</el-radio> | ||
</el-radio-group> | ||
</div> | ||
</div> | ||
<div class="attr-table-desc"> | ||
<el-table :data="tableAttrData" style="width: 100%"> | ||
<el-table-column | ||
v-for="item in tabcolums" | ||
:key="item.prop" | ||
:prop="item.prop" | ||
:label="item.label" | ||
align="center" | ||
header-align="center" | ||
></el-table-column> | ||
</el-table> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Prism from "prismjs"; | ||
import { writingModeData, tableColums } from "./writemodedesc"; | ||
export default { | ||
name: "writeMode", | ||
data() { | ||
return { | ||
writingModeVal: "horizontal-tb", | ||
writingModes: [ | ||
"horizontal-tb", | ||
"vertical-rl", | ||
"vertical-lr", | ||
"sideways-rl", | ||
"sideways-lr" | ||
], | ||
tableAttrData: writingModeData, | ||
tabcolums: tableColums | ||
}; | ||
}, | ||
watch: { | ||
writingModeVal() { | ||
this.updateCss(); | ||
} | ||
}, | ||
methods: { | ||
updateCss() { | ||
this.$refs["css"].innerHTML = Prism.highlight( | ||
`writing-mode: ${this.writingModeVal};\n-webkit-writing-mode: ${this.writingModeVal};\n-ms-writing-mode: ${this.writingModeVal}`, | ||
Prism.languages.css | ||
); | ||
} | ||
}, | ||
mounted() { | ||
this.updateCss(); | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.effect-display-wrap { | ||
line-height: 40px; | ||
margin: 15px auto; | ||
border: 1px solid #ddd; | ||
padding: 15px; | ||
} | ||
.attr-operate-wrap { | ||
display: flex; | ||
flex-direction: column; | ||
align-content: flex-start; | ||
} | ||
.el-radio-group { | ||
display: flex; | ||
justify-content: flex-start; | ||
align-content: flex-start; | ||
flex-wrap: wrap; | ||
margin: 25px 0; | ||
.radio { | ||
margin-bottom: 15px; | ||
} | ||
label { | ||
width: 20%; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const writingModeData = [ | ||
{ | ||
attr: 'writing-mode', | ||
type: 'String', | ||
value: 'horizontal-tb/vertical-rl/vertical-lr/sideways-rl/sideways-lr', | ||
descption: | ||
'决定文本在水平或垂直方向上如何排布horizontal-tb表示水平,vertical-rl表示垂直', | ||
}, | ||
]; | ||
|
||
const tableColums = [ | ||
{ | ||
prop: 'attr', | ||
label: '属性', | ||
}, | ||
{ | ||
prop: 'type', | ||
label: '类型', | ||
}, | ||
|
||
{ | ||
prop: 'value', | ||
label: '值', | ||
width: '200px', | ||
}, | ||
{ | ||
prop: 'descption', | ||
label: '说明', | ||
}, | ||
]; | ||
|
||
export { writingModeData, tableColums }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
title:弹性盒模型 | ||
--- | ||
|
||
# 弹性盒模型 | ||
## 弹性盒模型 | ||
|
||
弹性盒模型 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: 文字水平及垂直方向显示排布 | ||
--- | ||
|
||
## 文字水平及垂直方向显示排布 | ||
|
||
## 快速导航 | ||
|
||
<TOC /> | ||
|
||
<writemode-writeMode /> | ||
|
||
::: details 点击即可查看代码 | ||
|
||
```css | ||
writing-mode: vertical-rl; | ||
-webkit-writing-mode: vertical-rl; | ||
-ms-writing-mode: vertical-rl; | ||
``` | ||
|
||
::: | ||
|
||
- `horizontal-tb`:此值定义了从上到下的块流动方向,水平方向自上而下的书写方式。即 `left-right-top-bottom`。 | ||
- `vertical-rl`:此值定义从右到左书写方式。即 `top-bottom-right-left` | ||
- `vertical-lr`:该值定义了从左到右的书写方式,垂直方向内内容从上到下,水平方向从左到右 | ||
- `sideways-rl`:内容垂直方向从上到下排列 | ||
- `sideways-lr`:内容垂直方向从下到上排列 | ||
|
||
这个`writing-mode`属性在文本布局时非常方便,好用,有时候,当想要文本垂直方向显示就会用到 | ||
|
||
<footer-FooterLink :isShareLink="true" :isDaShang="true" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.