Explain how to use Vue based Widgets
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, laravel, php, vite
- Área
- documentation
Línea de trabajo
Start with the Widgets documentation and compare it with the linked Vite Tooling page. Explain the package.json dependency, the Vite plugin setup, and registering the Vue component in cp.js, including the working component name shown in the issue. Done when the Widget guide lets a reader follow the steps and see the component render; the issue names no documentation file or test.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The documentation explains how to create a Widget, but doesn't actually explain how to get it to render...
If I just follow the steps in the docs, the Dashboard will try render the component but you'll see this in the source:
<div class="px-3 starting-style-transition null w-full">
<missingtranslations message="Hello World!"></missingtranslations>
</div>
This is for a component called MissingTranslations
<?php
namespace App\Widgets;
use Statamic\Facades\Entry;
use Statamic\Sites\Sites;
use Statamic\Widgets\VueComponent;
use Statamic\Widgets\Widget;
class MissingTranslations extends Widget
{
public function component()
{
return VueComponent::render('MissingTranslations', [
'message' => 'Hello World!',
]);
}
}
To actually get the Widget to render you need to follow some steps in the Vite Tooling page:
First the package.json needs to be updated to install @statamic
"dependencies": {
"@statamic/cms": "file:./vendor/statamic/cms/resources/dist-package"
},
Then you need to run npm install and add the Statamic plugin to the Vite config:
import statamic from '@statamic/cms/vite-plugin';
export default defineConfig({
plugins: [
laravel({ ... }),
statamic(),
],
});
And then the component still needs to be registered? in cp.js
import MissingTranslations from './components/widgets/MissingTranslations.vue';
Statamic.booting(() => {
// Statamic.$components.register('missing-translations', MissingTranslations); // doesnt work
// Statamic.$components.register('missingtranslations', MissingTranslations); // doesnt work
Statamic.$components.register('MissingTranslations', MissingTranslations); // works
});
That's a lot of extra steps that seem to be missing and important? I can't figure out if there was an easier way to get it to do all this automatically or if I totally missed something...
- Lenguaje dominante
- PHP
- Estrellas
- 133
- Forks
- 405
- Merge medio
- 21 h 45 min
- PR fusionados (30 d)
- 12
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de statamic/docs
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Chunked UploadsAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Installation / Deployment Guides
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 40/100
Los mantenedores suelen responder en 1 día
-
Document how conditions treat empty and null valuesPosiblemente ocupada @joshdaugherty la tomó hace 13 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de statamic/docs
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
scanaislop/aislop#482 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
humanmade/publication-checklist#73 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Werkstattl/OpenBlogware#92 ·