wechat-miniprogram / wechat-miniprogram/computed

behavior方式引用不能正常显示

Open
#100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
696
Forks
61
PR merge metrics
No merged PRs in 30d

Description

这种方式不支持
const computedBehavior = require('miniprogram-computed').behavior Page({ behavior:[computedBehavior], computed:{ sum(data){ return data.number1+data.number2; }, },

只能支持import { ComponentWithComputed } from 'miniprogram-computed'方式引用

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the shown require('miniprogram-computed').behavior example and compare it with the supported ComponentWithComputed import usage. Trace the behavior entry point and verify that the require form displays and works correctly while the existing import form remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.