Skip to content

Commit 82a098c

Browse files
committed
feat: make css paddings work out-of-the-box
1 parent 3da9f28 commit 82a098c

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.6.1
2+
3+
* Make `padding` work out-of-the-box.
4+
15
## 6.6.0
26

37
* Added support for `autoresize` accepting an options object to specify custom throttle delay or resize callback.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-echarts",
3-
"version": "6.6.0",
3+
"version": "6.6.1",
44
"description": "Vue.js component for Apache ECharts.",
55
"author": "GU Yiling <[email protected]>",
66
"scripts": {

src/ECharts.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export default defineComponent({
7373
inheritAttrs: false,
7474
setup(props, { attrs }) {
7575
const root = shallowRef<EChartsElement>();
76+
const inner = shallowRef<HTMLElement>();
7677
const chart = shallowRef<EChartsType>();
7778
const manualOption = shallowRef<Option>();
7879
const defaultTheme = inject(THEME_KEY, null);
@@ -99,12 +100,12 @@ export default defineComponent({
99100
const listeners = getCurrentInstance().proxy.$listeners;
100101

101102
function init(option?: Option) {
102-
if (!root.value) {
103+
if (!inner.value) {
103104
return;
104105
}
105106

106107
const instance = (chart.value = initChart(
107-
root.value,
108+
inner.value,
108109
realTheme.value,
109110
realInitOptions.value
110111
));
@@ -271,7 +272,7 @@ export default defineComponent({
271272

272273
useLoading(chart, loading, loadingOptions);
273274

274-
useAutoresize(chart, autoresize, root);
275+
useAutoresize(chart, autoresize, inner);
275276

276277
onMounted(() => {
277278
init();
@@ -292,6 +293,7 @@ export default defineComponent({
292293
return {
293294
chart,
294295
root,
296+
inner,
295297
setOption,
296298
nonEventAttrs,
297299
...publicApi
@@ -305,6 +307,6 @@ export default defineComponent({
305307
) as any;
306308
attrs.ref = "root";
307309
attrs.class = attrs.class ? ["echarts"].concat(attrs.class) : "echarts";
308-
return h(TAG_NAME, attrs);
310+
return h(TAG_NAME, attrs, [h("div", { ref: "inner" })]);
309311
}
310312
});

src/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
x-vue-echarts{display:block;width:100%;height:100%;min-width:0}
1+
x-vue-echarts{display:block;width:100%;height:100%;min-width:0}x-vue-echarts>div{width:100%;height:100%}

0 commit comments

Comments
 (0)