Skip to content

How about supporting object depth when using function properties? #167

Open
@twoshlove

Description

@twoshlove

A namespace is needed because your plugin uses a global function.

In the current structure, only window 1depth objects can be registered.

parse: (value, attribute, element) => {
    const fn = (() => {
      if (typeof window !== "undefined" && value in window) {
        // @ts-expect-error
        return window[value] // only window 1depth objects can be registered!!
      }

      if (typeof global !== "undefined" && value in global) {
        // @ts-expect-error
        return global[value]
      }
    })()

    return typeof fn === "function" ? fn.bind(element) : undefined
  },

It would be nice to modify this part so that it can be defined as N depth.

<custom-ele func="action" /> ( O )
<custom-ele func="ns.action" /> ( X )
<custom-ele func="ns.action.get" /> ( X )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions