Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue ts中:height会直接报错,而且不能渲染出来 #13

Open
Lcj-space opened this issue Nov 6, 2019 · 3 comments
Open

Vue ts中:height会直接报错,而且不能渲染出来 #13

Lcj-space opened this issue Nov 6, 2019 · 3 comments

Comments

@Lcj-space
Copy link

在Vue 2.0 结合ts使用的时候发现上述标题错误

@yansenlei
Copy link
Owner

麻烦提供下版本号和代码等信息

@Lcj-space
Copy link
Author

这个用的时候想全局使用,Vue的项目用了ts当插件的话由于这个包没有类型约束。所以只能是单独引进

@zolotarev
Copy link

zolotarev commented Dec 18, 2019

<template lang="html">
  <div class="jsoneditor-container" :class="{'max-box':max,'min-box':!max}" :style="getHeight">
    <div ref="jsoneditor" class="jsoneditor-box"></div>
    <button type="button" @click="max = !max" class="max-btn" size="mini"
            v-if="options.mode == 'code' && plus"></button>
  </div>
</template>
....
computed: {
      getHeight() {
        if (this.height && !this.max) {
          return {
            height: this.height
          }
        }
        return {}
      }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants