Skip to content

Commit a4198be

Browse files
committed
fix: Adding maxheight invalidates the height of the block
1 parent 982c1d7 commit a4198be

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-highlight-code",
33
"private": false,
4-
"version": "0.1.5",
4+
"version": "0.1.6",
55
"license": "MIT",
66
"main": "./dist/vue3-highlight.umd.js",
77
"module": "./dist/vue3-highlight.es.js",

src/App.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default {
2020
const light = 'light'
2121
const vue = 'vue'
2222
const dark = 'dark'
23+
const height = '200px'
2324
</script>
2425
<template>
2526
<div class="wrapper">
@@ -29,6 +30,7 @@ const dark = 'dark'
2930
:codeValue="value"
3031
:theme="dark"
3132
:lang="vue"
33+
:maxHeight="height"
3234
></HighCode>
3335
<HighCode
3436
class="code"

src/components/CopyCode.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const getContent = () => {
6565
cursor: pointer;
6666
transition: 0.3s opacity linear;
6767
opacity: 0.5;
68-
height: 40px;
68+
height: 30px;
6969
width: 80px;
7070
// float: right;
7171
right: 0px;

src/components/HighCode.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ nextTick(() => {
194194
&_header {
195195
position: relative;
196196
display: flex;
197-
justify-content: space-around;
198-
height: 40px;
197+
justify-content: flex-start;
198+
height: 30px;
199199
width: 100%;
200200
}
201201
pre code {
@@ -222,7 +222,7 @@ nextTick(() => {
222222
flex-direction: column;
223223
width: 10px;
224224
// justify-content: center;
225-
padding-top: 40px;
225+
padding-top: 30px;
226226
align-items: center;
227227
position: absolute;
228228
transform: translateX(6px);

src/components/TypeShow.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ const props = defineProps({
1919
align-items: center;
2020
justify-content: center;
2121
width: 40px;
22-
height: 40px;
23-
position: absolute;
24-
left: 0px;
22+
height: 30px;
23+
position: relative;
24+
// left: 0px;
2525
&_word {
2626
width: 20px;
2727
height: 20px;

vite.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export default defineConfig({
99
build: {
1010
lib: {
1111
entry: resolve(__dirname, 'src/build.js'),
12-
name: 'vue3-highlight',
13-
fileName: (format) => `vue3-highlight.${format}.js`
12+
name: 'vue-highlight-code',
13+
fileName: (format) => `vue-highlight-code.${format}.js`
1414
},
1515
sourcemap: true,
1616
rollupOptions: {

0 commit comments

Comments
 (0)