Open Zugidor opened 1 year ago
A year later and though this still works, there are some new thoughts on this for me. Mainly, this will only seem to work in the options API mode of Vue. The "webpartproperties" functions to pass properties still add them to the instance properly. The issue is that you can't use "this" in the "script setup" option of the composition API so you lose access to "this.$root" The only option I can think of here is to use an outer wrapper component to perform this piece but pass the data to a new composition API component.
Includes @LOLCATATONIA's PR #8.
Kept sample as similar/faithful as possible, changing only what was necessary for the new SPFx, Vite, and PnP versions.
Credit for getting Vite 4 working to @spevilgenius. This should build with no errors as is.
Reasoning: It's nice to keep this up-to-date for anyone who may find it useful like I have. The update included non-negligible changes and troubleshooting.